Skip to content

Commit 9bcc559

Browse files
committed
add clang with -f3c-tool to tests
1 parent ab598df commit 9bcc559

9 files changed

+15
-21
lines changed

clang/test/3C/allarrays.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s
2-
3-
// Currently not possible to run clang on the output,
4-
// since 3c cannot yet determine array bounds for q
2+
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
53

64
int* foo();
75
//CHECK: _Array_ptr<int> foo(_Array_ptr<int> r);

clang/test/3C/arrboundsadvanced.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s
2-
3-
// Currently not possible to run clang on the output,
4-
// since 3c cannot yet determine array bounds for intarr
2+
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
53

64
/*
75
Advanced array-bounds inference (based on control-dependencies).
@@ -19,12 +17,12 @@ struct foo1 {
1917
unsigned ml;
2018
};
2119
//CHECK: _Array_ptr<int> x : count(ml);
20+
unsigned FooLenD;
21+
unsigned FooLen;
2222
struct foo **FL;
2323
int *intarr;
2424
//CHECK: _Array_ptr<_Ptr<struct foo>> FL : count(FooLen) = ((void *)0);
2525
//CHECK: _Array_ptr<int> intarr = ((void *)0);
26-
unsigned FooLenD;
27-
unsigned FooLen;
2826
void intcopy(int *arr, int *ptr, int len) {
2927
int i;
3028
for (i=0; i<len; i++) {

clang/test/3C/extGVarbar2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//RUN: %clang -c %S/extGVarbar2.checked2.c %S/extGVarbar1.checked2.c
44
//RUN: rm %S/extGVarbar1.checked2.c %S/extGVarbar2.checked2.c
55

6-
/*second of the bar files*/
6+
// This test cannot use pipes because it requires multiple output files
77

88
int w = 2;
99
int *y = &w;

clang/test/3C/extGVarm2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//RUN: %clang -c %S/extGVarm2.checked2.c %S/extGVarm3.checked2.c %S/extGVarm1.checked2.c
44
//RUN: rm %S/extGVarm1.checked2.c %S/extGVarm2.checked2.c %S/extGVarm3.checked2.c
55

6+
// This test cannot use pipes because it requires multiple output files
7+
68
extern int *x;
79
//CHECK: extern int *x;
810

clang/test/3C/extGVarm3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//RUN: %clang -c %S/extGVarm3.checked3.c %S/extGVarm2.checked3.c %S/extGVarm1.checked3.c
44
//RUN: rm %S/extGVarm1.checked3.c %S/extGVarm2.checked3.c %S/extGVarm3.checked3.c
55

6-
// This test cannot use pipes because it uses multiple input files
6+
// This test cannot use pipes because it requires multiple output files
77

88
extern int *x;
99
//CHECK: extern int *x;

clang/test/3C/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: 3c -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
22

33
// Currently not possible to run clang on the output,
4-
// since 3c cannot yet determine array bounds for hash_get_bucket
4+
// there is an error reported at https://github.com/correctcomputation/checkedc-clang/issues/349
55

66
/*
77
* Based on hash.c in Very Secure FTPd

clang/test/3C/partial_checked_arr.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
// RUN: 3c -addcr -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s
2+
// RUN: 3c -addcr -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
23
// RUN: 3c -addcr %s | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s
3-
// RUN: 3c -alltypes -output-postfix=checked %s
4-
// RUN: 3c -alltypes %S/partial_checked_arr.checked.c | count 0
5-
// RUN: rm %S/partial_checked_arr.checked.c
6-
7-
// Currently not possible to run clang on the output,
8-
// since 3c cannot yet determine array bounds in this case
4+
// RUN: 3c -addcr %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
5+
// RUN: 3c -alltypes %s > %t
6+
// RUN: 3c -alltypes %t | count 0
97

108
int strcmp(const char *src1 : itype(_Nt_array_ptr<const char>),
119
const char *src2 : itype(_Nt_array_ptr<const char>));

clang/test/3C/patch_issue_272.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s
2+
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
23

34
/********************************************************************/
45
/* Tests to keep pointer level from */
56
/* https://github.com/correctcomputation/checkedc-clang/issues/272 */
6-
/* */
7-
/* Currently not possible to run clang on the output, */
8-
/* since 3c cannot yet determine full array bounds in this case */
9-
/* */
107
/********************************************************************/
118

129
int *a[];

clang/test/3C/untypedprototypes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s
2+
// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o /dev/null -
23

34
// Currently not possible to run clang on the output,
45
// since 3c cannot yet determine array bounds in this case

0 commit comments

Comments
 (0)