diff --git a/clang/test/3C/allarrays.c b/clang/test/3C/allarrays.c index 29c9e7a24846..ec55cce7577e 100644 --- a/clang/test/3C/allarrays.c +++ b/clang/test/3C/allarrays.c @@ -1,4 +1,5 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t1.unused - int* foo(); //CHECK: _Array_ptr foo(_Array_ptr r); diff --git a/clang/test/3C/arrboundsadvanced.c b/clang/test/3C/arrboundsadvanced.c index df629c951327..e273b90d2add 100644 --- a/clang/test/3C/arrboundsadvanced.c +++ b/clang/test/3C/arrboundsadvanced.c @@ -1,5 +1,5 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s - +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t1.unused - /* Advanced array-bounds inference (based on control-dependencies). @@ -17,12 +17,12 @@ struct foo1 { unsigned ml; }; //CHECK: _Array_ptr x : count(ml); +unsigned FooLenD; +unsigned FooLen; struct foo **FL; int *intarr; //CHECK: _Array_ptr<_Ptr> FL : count(FooLen) = ((void *)0); //CHECK: _Array_ptr intarr = ((void *)0); -unsigned FooLenD; -unsigned FooLen; void intcopy(int *arr, int *ptr, int len) { int i; for (i=0; i)) ; diff --git a/clang/test/3C/basic_inter_ntarr.c b/clang/test/3C/basic_inter_ntarr.c index 9613f244ab4c..8f3634ffbd24 100644 --- a/clang/test/3C/basic_inter_ntarr.c +++ b/clang/test/3C/basic_inter_ntarr.c @@ -2,7 +2,8 @@ // // Tests rewriting and propagation of Nt_array_ptr constraints across functions. // -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t1.unused - // char *strstr(const char *s1 : itype(_Nt_array_ptr), const char *s2 : itype(_Nt_array_ptr)) : itype(_Nt_array_ptr); diff --git a/clang/test/3C/basic_local_ntarr.c b/clang/test/3C/basic_local_ntarr.c index f03d89e588d4..cae3598b9136 100644 --- a/clang/test/3C/basic_local_ntarr.c +++ b/clang/test/3C/basic_local_ntarr.c @@ -2,7 +2,8 @@ // // Tests basic rewriting of Nt_array_ptrs -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t1.unused - // unsigned long strlen(const char *s : itype(_Nt_array_ptr)); @@ -18,7 +19,7 @@ int main() { int b; // this will make a as NTARR b = strlen(a); - // this will make C as NTArr + // this will make C as PTR c = strstr("Hello", "World"); // this should mark d as WILD. d = (int*)0xdeadbeef; diff --git a/clang/test/3C/basic_return_itype.c b/clang/test/3C/basic_return_itype.c index 6616d371ac1b..84dab39e870a 100644 --- a/clang/test/3C/basic_return_itype.c +++ b/clang/test/3C/basic_return_itype.c @@ -2,7 +2,8 @@ // // Tests properties about rewriter for return type when it is an itype // -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t1.unused - // static int funcvar; diff --git a/clang/test/3C/checkedregionvoid.c b/clang/test/3C/checkedregionvoid.c index 0dc9c3fead55..629c0568eb65 100644 --- a/clang/test/3C/checkedregionvoid.c +++ b/clang/test/3C/checkedregionvoid.c @@ -1,7 +1,7 @@ -// RUN: 3c -addcr %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | %clang -c -fcheckedc-extension -x c -o %t1.unused - -#include "dummy.h" -// Dummy to cause output +void unsafe(void *);// Dummy to cause output void f(int *x) {} //CHECK: void f(_Ptr x) _Checked {} diff --git a/clang/test/3C/contextsensitivebounds.c b/clang/test/3C/contextsensitivebounds.c index 226de455523d..5988bdc51031 100644 --- a/clang/test/3C/contextsensitivebounds.c +++ b/clang/test/3C/contextsensitivebounds.c @@ -2,8 +2,11 @@ Test for context sensitive bounds. **/ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s -// RUN: 3c %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t1.unusedl - +// RUN: 3c %s | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// RUN: 3c %s | %clang -c -fcheckedc-extension -x c -o %t2.unused - + _Itype_for_any(T) void *somefunc(unsigned long size) : itype(_Array_ptr) byte_count(size); struct hash_node { diff --git a/clang/test/3C/contextsensitivebounds1.c b/clang/test/3C/contextsensitivebounds1.c index 115a70bd414f..71d0cd1a13ff 100644 --- a/clang/test/3C/contextsensitivebounds1.c +++ b/clang/test/3C/contextsensitivebounds1.c @@ -2,8 +2,11 @@ Test for context sensitive bounds for internal functions. **/ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s -// RUN: 3c %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t1.unused - +// RUN: 3c %s | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// RUN: 3c %s | %clang -c -fcheckedc-extension -x c -o %t2.unused - + _Itype_for_any(T) void *somefunc(unsigned long size) : itype(_Array_ptr) byte_count(size); struct hash_node { diff --git a/clang/test/3C/difftypes_xfail1.c b/clang/test/3C/difftypes_xfail1.c index 2e5adef83f15..b44fe2230815 100644 --- a/clang/test/3C/difftypes_xfail1.c +++ b/clang/test/3C/difftypes_xfail1.c @@ -1,4 +1,7 @@ //RUN: 3c -base-dir=%S -output-postfix=checked %s %S/difftypes_xfail2.c -// XFAIL: * + +// XFAIL: * + +// The desired behavior in this case is to fail, so other checks are omitted _Ptr foo(int, char); diff --git a/clang/test/3C/difftypes_xfail2.c b/clang/test/3C/difftypes_xfail2.c index 9b1b1a09113c..d85951033c95 100644 --- a/clang/test/3C/difftypes_xfail2.c +++ b/clang/test/3C/difftypes_xfail2.c @@ -1,4 +1,7 @@ //RUN: 3c -base-dir=%S -output-postfix=checked %s %S/difftypes_xfail1.c + // XFAIL: * +// The desired behavior in this case is to fail, so other checks are omitted + int * foo(int, char *); diff --git a/clang/test/3C/dummy.h b/clang/test/3C/dummy.h deleted file mode 100644 index 6dc452825056..000000000000 --- a/clang/test/3C/dummy.h +++ /dev/null @@ -1,2 +0,0 @@ - -void unsafe(void *); diff --git a/clang/test/3C/extGVarbar1.c b/clang/test/3C/extGVarbar1.c index 06b9b6fad05b..4247c3e9c79a 100644 --- a/clang/test/3C/extGVarbar1.c +++ b/clang/test/3C/extGVarbar1.c @@ -3,7 +3,7 @@ //RUN: %clang -c %S/extGVarbar1.checked.c %S/extGVarbar2.checked.c //RUN: rm %S/extGVarbar1.checked.c %S/extGVarbar2.checked.c -/*first of the bar files*/ +// This test cannot use pipes because it requires multiple output files extern int *x; /*y will be defined in bar2.c*/ diff --git a/clang/test/3C/extGVarbar2.c b/clang/test/3C/extGVarbar2.c index af1f14e1bb44..6183f2599da2 100644 --- a/clang/test/3C/extGVarbar2.c +++ b/clang/test/3C/extGVarbar2.c @@ -1,8 +1,9 @@ //RUN: 3c -base-dir=%S -output-postfix=checked2 %s %S/extGVarbar1.c //RUN: FileCheck -match-full-lines --input-file %S/extGVarbar2.checked2.c %s +//RUN: %clang -c %S/extGVarbar2.checked2.c %S/extGVarbar1.checked2.c //RUN: rm %S/extGVarbar1.checked2.c %S/extGVarbar2.checked2.c -/*second of the bar files*/ +// This test cannot use pipes because it requires multiple output files int w = 2; int *y = &w; diff --git a/clang/test/3C/extGVarm1.c b/clang/test/3C/extGVarm1.c index 90007b5d5cb0..0ce4cc8f6950 100644 --- a/clang/test/3C/extGVarm1.c +++ b/clang/test/3C/extGVarm1.c @@ -3,6 +3,8 @@ //RUN: %clang -c %S/extGVarm1.checked.c %S/extGVarm2.checked.c %S/extGVarm3.checked.c //RUN: rm %S/extGVarm1.checked.c %S/extGVarm2.checked.c %S/extGVarm3.checked.c +// This test cannot use pipes because it requires multiple output files + extern int *y; //CHECK: extern _Ptr y; diff --git a/clang/test/3C/extGVarm2.c b/clang/test/3C/extGVarm2.c index c9739aa5394e..2eb0404ad30a 100644 --- a/clang/test/3C/extGVarm2.c +++ b/clang/test/3C/extGVarm2.c @@ -1,7 +1,10 @@ //RUN: 3c -base-dir=%S -output-postfix=checked2 %s %S/extGVarm1.c %S/extGVarm3.c //RUN: FileCheck -match-full-lines --input-file %S/extGVarm2.checked2.c %s +//RUN: %clang -c %S/extGVarm2.checked2.c %S/extGVarm3.checked2.c %S/extGVarm1.checked2.c //RUN: rm %S/extGVarm1.checked2.c %S/extGVarm2.checked2.c %S/extGVarm3.checked2.c +// This test cannot use pipes because it requires multiple output files + extern int *x; //CHECK: extern int *x; diff --git a/clang/test/3C/extGVarm3.c b/clang/test/3C/extGVarm3.c index a38b550b9dde..162406a31235 100644 --- a/clang/test/3C/extGVarm3.c +++ b/clang/test/3C/extGVarm3.c @@ -1,7 +1,10 @@ //RUN: 3c -base-dir=%S -output-postfix=checked3 %s %S/extGVarm1.c %S/extGVarm2.c //RUN: FileCheck -match-full-lines --input-file %S/extGVarm3.checked3.c %s +//RUN: %clang -c %S/extGVarm3.checked3.c %S/extGVarm2.checked3.c %S/extGVarm1.checked3.c //RUN: rm %S/extGVarm1.checked3.c %S/extGVarm2.checked3.c %S/extGVarm3.checked3.c +// This test cannot use pipes because it requires multiple output files + extern int *x; //CHECK: extern int *x; diff --git a/clang/test/3C/hash.c b/clang/test/3C/hash.c index 00a04362d899..401568bd5f30 100644 --- a/clang/test/3C/hash.c +++ b/clang/test/3C/hash.c @@ -1,4 +1,8 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s + +// Currently not possible to run clang on the output, +// there is an error reported at https://github.com/correctcomputation/checkedc-clang/issues/349 + /* * Based on hash.c in Very Secure FTPd */ diff --git a/clang/test/3C/lit.local.cfg b/clang/test/3C/lit.local.cfg index 5ab27370c9bf..856a54932f0b 100644 --- a/clang/test/3C/lit.local.cfg +++ b/clang/test/3C/lit.local.cfg @@ -1,6 +1 @@ -# import os config.suffixes = ['.c'] -# config.environment = { -# 'CHECKED_CPATH':'/Users/mwh/checkedc/checkedc/include/:', -# 'PATH':'/Users/mwh/checkedc/checkedc-clang/llvm/cmake-debug-build/bin:'+os.getenv('PATH') -# } diff --git a/clang/test/3C/lowerbound.c b/clang/test/3C/lowerbound.c index 85d36226916e..da6d774b0950 100644 --- a/clang/test/3C/lowerbound.c +++ b/clang/test/3C/lowerbound.c @@ -1,7 +1,8 @@ // Generates graph q0 --> ARR --> q1, to confirm that bound bound // constraints are properly solved // The following test is supposed to fail with the current tool. -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t.unused - // _Array_ptr foo(_Array_ptr x); diff --git a/clang/test/3C/lowerboundBUG.c b/clang/test/3C/lowerboundBUG.c deleted file mode 100644 index 85d36226916e..000000000000 --- a/clang/test/3C/lowerboundBUG.c +++ /dev/null @@ -1,15 +0,0 @@ -// Generates graph q0 --> ARR --> q1, to confirm that bound bound -// constraints are properly solved -// The following test is supposed to fail with the current tool. -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s -// - -_Array_ptr foo(_Array_ptr x); -void bar() { - int *y = 0; - int *z = 0; - y = foo(z); - y[2] = 1; -} -//CHECK: _Array_ptr y = 0; -//CHECK-NEXT: _Array_ptr z = 0; diff --git a/clang/test/3C/manyprotos.c b/clang/test/3C/manyprotos.c index 593b1472a417..d3d402128fae 100644 --- a/clang/test/3C/manyprotos.c +++ b/clang/test/3C/manyprotos.c @@ -1,4 +1,5 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t1.unused - int foo(); //CHECK: int foo(_Array_ptr x : count(y), int y); diff --git a/clang/test/3C/multidef_xfail1.c b/clang/test/3C/multidef_xfail1.c index 551a223ae7a9..b556b7c03d52 100644 --- a/clang/test/3C/multidef_xfail1.c +++ b/clang/test/3C/multidef_xfail1.c @@ -1,6 +1,9 @@ -//RUN: 3c -base-dir=%S -output-postfix=checked %s %S/multidef_xfail2.c +// RUN: 3c -base-dir=%S -output-postfix=checked %s %S/multidef_xfail2.c + // XFAIL: * +// The desired behavior in this case is to fail, so other checks are omitted + _Ptr foo(int x, char * y) { x = x + 4; int *z = &x; diff --git a/clang/test/3C/multidef_xfail2.c b/clang/test/3C/multidef_xfail2.c index 0f13b3f006ae..e2a8ce5022c7 100644 --- a/clang/test/3C/multidef_xfail2.c +++ b/clang/test/3C/multidef_xfail2.c @@ -1,5 +1,8 @@ -//RUN: 3c -base-dir=%S -output-postfix=checked %s %S/multidef_xfail1.c -// XFAIL: * +// RUN: 3c -base-dir=%S -output-postfix=checked %s %S/multidef_xfail1.c + +// XFAIL: * + +// The desired behavior in this case is to fail, so other checks are omitted int * foo(int x, _Ptr y) { x = x + 4; diff --git a/clang/test/3C/no_casts.c b/clang/test/3C/no_casts.c index 366f9bb5fae4..a858d451fcd8 100644 --- a/clang/test/3C/no_casts.c +++ b/clang/test/3C/no_casts.c @@ -1,4 +1,5 @@ // RUN: 3c %s | count 0 +// RUN: 3c %s | %clang -c -fcheckedc-extension -x c -o %t.unused - void foo(char *a); void bar(int *a); diff --git a/clang/test/3C/noproto.c b/clang/test/3C/noproto.c index 1e2bd05937cf..cece19c80b60 100644 --- a/clang/test/3C/noproto.c +++ b/clang/test/3C/noproto.c @@ -1,4 +1,5 @@ -// RUN: 3c -addcr %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | %clang -c -fcheckedc-extension -x c -o %t.unused - int foo(int x) { //CHECK: int foo(int x) { diff --git a/clang/test/3C/order.c b/clang/test/3C/order.c index 6a7c9e33aeed..b5e12893eddd 100644 --- a/clang/test/3C/order.c +++ b/clang/test/3C/order.c @@ -1,4 +1,5 @@ -// RUN: 3c %s -- | FileCheck -match-full-lines %s +// RUN: 3c %s | FileCheck -match-full-lines %s +// RUN: 3c %s | %clang -c -fcheckedc-extension -x c -o %t.unused - int foo1(int x, int *y); //CHECK: int foo1(int x, int *y : itype(_Ptr)); diff --git a/clang/test/3C/partial_checked_arr.c b/clang/test/3C/partial_checked_arr.c index f664f2115377..c1c6c54ca73c 100644 --- a/clang/test/3C/partial_checked_arr.c +++ b/clang/test/3C/partial_checked_arr.c @@ -1,8 +1,9 @@ -// RUN: 3c -addcr -alltypes %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s -// RUN: 3c -addcr %s -- | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s -// RUN: 3c -alltypes -output-postfix=checked %s -// RUN: 3c -alltypes %S/partial_checked_arr.checked.c -- | count 0 -// RUN: rm %S/partial_checked_arr.checked.c +// RUN: 3c -addcr -alltypes %s | FileCheck -match-full-lines -check-prefixes="CHECK_ALL","CHECK" %s +// RUN: 3c -addcr -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t1.unused - +// RUN: 3c -addcr %s | FileCheck -match-full-lines -check-prefixes="CHECK_NOALL","CHECK" %s +// RUN: 3c -addcr %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t2.unused - +// RUN: 3c -alltypes %s > %t +// RUN: 3c -alltypes %t | count 0 int strcmp(const char *src1 : itype(_Nt_array_ptr), const char *src2 : itype(_Nt_array_ptr)); diff --git a/clang/test/3C/patch_issue_272.c b/clang/test/3C/patch_issue_272.c index d4650a89c07a..a96ad33e2a7a 100644 --- a/clang/test/3C/patch_issue_272.c +++ b/clang/test/3C/patch_issue_272.c @@ -1,4 +1,5 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t.unused - /********************************************************************/ /* Tests to keep pointer level from */ diff --git a/clang/test/3C/pointerarithm.c b/clang/test/3C/pointerarithm.c index 42312aefcd1d..3132a79efb4b 100644 --- a/clang/test/3C/pointerarithm.c +++ b/clang/test/3C/pointerarithm.c @@ -1,6 +1,7 @@ -// RUN: 3c -alltypes -addcr %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes -addcr %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes -addcr %s | %clang -c -fcheckedc-extension -x c -o %t.unused - // RUN: 3c -addcr -alltypes -output-postfix=checked %s -// RUN: 3c -addcr -alltypes %S/pointerarithm.checked.c -- | count 0 +// RUN: 3c -addcr -alltypes %S/pointerarithm.checked.c | count 0 // RUN: rm %S/pointerarithm.checked.c #include diff --git a/clang/test/3C/prototype_success2.c b/clang/test/3C/prototype_success2.c index 077184aee051..95ea4cc83598 100644 --- a/clang/test/3C/prototype_success2.c +++ b/clang/test/3C/prototype_success2.c @@ -1,5 +1,6 @@ //RUN: 3c -base-dir=%S -output-postfix=checked2 %s %S/prototype_success1.c //RUN: FileCheck -match-full-lines --input-file %S/prototype_success2.checked2.c %s +//RUN: %clang -c %S/prototype_success1.checked2.c %S/prototype_success2.checked2.c //RUN: rm %S/prototype_success1.checked2.c %S/prototype_success2.checked2.c /*Note: this file is part of a multi-file regression test in tandem with prototype_success1.c diff --git a/clang/test/3C/regression_testsBUG.c b/clang/test/3C/regression_tests_xfail.c similarity index 81% rename from clang/test/3C/regression_testsBUG.c rename to clang/test/3C/regression_tests_xfail.c index 7f43821ac6ed..db0ad5149b26 100644 --- a/clang/test/3C/regression_testsBUG.c +++ b/clang/test/3C/regression_tests_xfail.c @@ -2,9 +2,8 @@ // // Tests 3c tool for any regressions. // -// The following test is supposed to fail with the current tool. -// XFAIL: * -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines %s +// RUN: 3c -alltypes %s | %clang -c -fcheckedc-extension -x c -o %t.unused - // // XFAIL: * diff --git a/clang/test/3C/root_cause.c b/clang/test/3C/root_cause.c index a00450f3c5d8..cb625f09eb04 100644 --- a/clang/test/3C/root_cause.c +++ b/clang/test/3C/root_cause.c @@ -1,4 +1,6 @@ -// RUN: 3c -extra-arg="-Wno-everything" -alltypes -warn-root-cause %s 2>&1 1>/dev/null | FileCheck %s +// RUN: 3c -extra-arg="-Wno-everything" -alltypes -warn-root-cause %s 2>&1 1>%t.unused | FileCheck %s + +// This test is unusual in that it checks for the errors in the code #include extern _Itype_for_any(T) void *malloc(size_t size) : itype(_Array_ptr) byte_count(size); diff --git a/clang/test/3C/stmtexpr.c b/clang/test/3C/stmtexpr.c index bb71ac57c565..5e4f4653fd9a 100644 --- a/clang/test/3C/stmtexpr.c +++ b/clang/test/3C/stmtexpr.c @@ -1,4 +1,5 @@ -// RUN: 3c -addcr %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -addcr %s | %clang -c -fcheckedc-extension -x c -o %t.unused - int foo(void) { //CHECK: int foo(void) { @@ -8,5 +9,5 @@ int foo(void) { // Dummy function to ensure output int dummy(int *x) { //CHECK: int dummy(_Ptr x) _Checked { - return x; + return *x; } diff --git a/clang/test/3C/untypedprototypes.c b/clang/test/3C/untypedprototypes.c index b0eda72c721f..7fe7fb54774d 100644 --- a/clang/test/3C/untypedprototypes.c +++ b/clang/test/3C/untypedprototypes.c @@ -1,4 +1,5 @@ -// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | FileCheck -match-full-lines --check-prefixes="CHECK" %s +// RUN: 3c -alltypes %s | %clang -c -f3c-tool -fcheckedc-extension -x c -o %t.unused - int *foo(); //CHECK: _Array_ptr foo(_Array_ptr q);