diff options
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/array-init.c | 17 | ||||
-rw-r--r-- | test/Sema/attr-deprecated.c | 2 | ||||
-rw-r--r-- | test/Sema/block-call.c | 52 | ||||
-rw-r--r-- | test/Sema/block-explicit-return-type.c | 66 | ||||
-rw-r--r-- | test/Sema/block-literal.c | 42 | ||||
-rw-r--r-- | test/Sema/block-misc.c | 24 | ||||
-rw-r--r-- | test/Sema/block-printf-attribute-1.c | 17 | ||||
-rw-r--r-- | test/Sema/block-return.c | 4 | ||||
-rw-r--r-- | test/Sema/block-sentinel-attribute.c | 25 | ||||
-rw-r--r-- | test/Sema/c89-2.c | 2 | ||||
-rw-r--r-- | test/Sema/c89.c | 2 | ||||
-rw-r--r-- | test/Sema/complex-int.c | 5 | ||||
-rw-r--r-- | test/Sema/conditional.c | 10 | ||||
-rw-r--r-- | test/Sema/darwin-align-cast.c | 4 | ||||
-rw-r--r-- | test/Sema/floating-point-compare.c | 4 | ||||
-rw-r--r-- | test/Sema/function-pointer-sentinel-attribute.c | 23 | ||||
-rw-r--r-- | test/Sema/function-sentinel-attr.c | 2 | ||||
-rw-r--r-- | test/Sema/implicit-int.c | 6 | ||||
-rw-r--r-- | test/Sema/predefined-function.c | 17 | ||||
-rw-r--r-- | test/Sema/static-init.c | 4 | ||||
-rw-r--r-- | test/Sema/struct-decl.c | 20 | ||||
-rw-r--r-- | test/Sema/transparent-union-pointer.c | 8 |
22 files changed, 168 insertions, 188 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c index b7542b301b..c78fd29a89 100644 --- a/test/Sema/array-init.c +++ b/test/Sema/array-init.c @@ -144,12 +144,11 @@ int xx_sizecheck[(sizeof(xx) / sizeof(char)) == 5? 1 : -1]; static char const yy[5] = "test"; static char const zz[3] = "test"; // expected-warning{{initializer-string for char array is too long}} -void charArrays() -{ - static char const test[] = "test"; - int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1]; - static char const test2[] = { "weird stuff" }; - static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}} +void charArrays() { + static char const test[] = "test"; + int test_sizecheck[(sizeof(test) / sizeof(char)) == 5? 1 : -1]; + static char const test2[] = { "weird stuff" }; + static char const test3[] = { "test", "excess stuff" }; // expected-warning{{excess elements in char array initializer}} char* cp[] = { "Hello" }; @@ -230,15 +229,15 @@ int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit) // ptrs are constant struct soft_segment_descriptor { - long ssd_base; + long ssd_base; }; static int dblfault_tss; union uniao { int ola; } xpto[1]; struct soft_segment_descriptor gdt_segs[] = { - {(long) &dblfault_tss}, - { (long)xpto}, + {(long) &dblfault_tss}, + { (long)xpto}, }; static void sppp_ipv6cp_up(); diff --git a/test/Sema/attr-deprecated.c b/test/Sema/attr-deprecated.c index 6597bad4b5..e15381e4c6 100644 --- a/test/Sema/attr-deprecated.c +++ b/test/Sema/attr-deprecated.c @@ -21,7 +21,7 @@ int a() { // test if attributes propagate to variables extern int var; int w() { - return var; // expected-warning {{'var' is deprecated}} + return var; // expected-warning {{'var' is deprecated}} } int old_fn() __attribute__ ((deprecated)); diff --git a/test/Sema/block-call.c b/test/Sema/block-call.c index c42b642337..893a8f61da 100644 --- a/test/Sema/block-call.c +++ b/test/Sema/block-call.c @@ -5,51 +5,47 @@ int (^IFP) (); int (^II) (int); int main() { int (*FPL) (int) = FP; // C doesn't consider this an error. - + // For Blocks, the ASTContext::typesAreBlockCompatible() makes sure this is an error. int (^PFR) (int) = IFP; // OK - PFR = II; // OK - - int (^IFP) () = PFR; // OK - + PFR = II; // OK - const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}} + int (^IFP) () = PFR; // OK - const int (^CICC) () = CIC; + const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int (^)()', expected 'int const (^)()'}} - int * const (^IPCC) () = 0; + const int (^CICC) () = CIC; - int * const (^IPCC1) () = IPCC; + int * const (^IPCC) () = 0; - int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}} + int * const (^IPCC1) () = IPCC; - int (^IPCC3) (const int) = PFR; + int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *const (^)()', expected 'int *(^)()'}} + int (^IPCC3) (const int) = PFR; - int (^IPCC4) (int, char (^CArg) (double)); + int (^IPCC4) (int, char (^CArg) (double)); + int (^IPCC5) (int, char (^CArg) (double)) = IPCC4; - int (^IPCC5) (int, char (^CArg) (double)) = IPCC4; + int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}} - int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(double))', expected 'int (^)(int, char (^)(float))'}} - - IPCC2 = 0; - IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}} - int (^x)() = 0; - int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}} - int a = 1; - int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}} + IPCC2 = 0; + IPCC2 = 1; // expected-error {{invalid conversion assigning integer 'int', expected block pointer 'int *(^)()'}} + int (^x)() = 0; + int (^y)() = 3; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}} + int a = 1; + int (^z)() = a+4; // expected-error {{invalid conversion initializing integer 'int', expected block pointer 'int (^)()'}} } int blah() { - int (^IFP) (float); - char (^PCP)(double, double, char); + int (^IFP) (float); + char (^PCP)(double, double, char); - IFP(1.0); - IFP (1.0, 2.0); // expected-error {{too many arguments to block call}} + IFP(1.0); + IFP (1.0, 2.0); // expected-error {{too many arguments to block call}} - char ch = PCP(1.0, 2.0, 'a'); - return PCP(1.0, 2.0); // expected-error {{too few arguments to block}} + char ch = PCP(1.0, 2.0, 'a'); + return PCP(1.0, 2.0); // expected-error {{too few arguments to block}} } - diff --git a/test/Sema/block-explicit-return-type.c b/test/Sema/block-explicit-return-type.c index c7b26b3d6b..f0a033dc0d 100644 --- a/test/Sema/block-explicit-return-type.c +++ b/test/Sema/block-explicit-return-type.c @@ -19,42 +19,39 @@ typedef void (^completion_block_t)(void); typedef double (^myblock)(int); double test(myblock I); -int main() -{ - __block int x = 1; - __block int y = 2; - - (void)^void *{ return 0; }; - - (void)^float(float y){ return y; }; - - (void)^double (float y, double d) - { - if (y) - return d; - else - return y; - }; - - const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) { - if (flag) - return 0; - if (flag == 1) - return arg; - else if (flag == 2) - return ""; - return arg1; - }; - - (void)^PF { return &gf; }; - - some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; }); - - double res = test(^(int z){x = y+z; return (double)z; }); +int main() { + __block int x = 1; + __block int y = 2; + + (void)^void *{ return 0; }; + + (void)^float(float y){ return y; }; + + (void)^double (float y, double d) { + if (y) + return d; + else + return y; + }; + + const char * (^chb) (int flag, const char *arg, char *arg1) = ^ const char * (int flag, const char *arg, char *arg1) { + if (flag) + return 0; + if (flag == 1) + return arg; + else if (flag == 2) + return ""; + return arg1; + }; + + (void)^PF { return &gf; }; + + some_func(^ NSView * (id whatever) { return [some_object some_method_that_returns_id]; }); + + double res = test(^(int z){x = y+z; return (double)z; }); } -void func() -{ +void func() { completion_block_t X; completion_block_t (^blockx)(dispatch_item_t) = ^completion_block_t (dispatch_item_t item) { @@ -66,7 +63,6 @@ void func() }; blockx = blocky; - } diff --git a/test/Sema/block-literal.c b/test/Sema/block-literal.c index c4aadd5d48..9f5022dc63 100644 --- a/test/Sema/block-literal.c +++ b/test/Sema/block-literal.c @@ -12,34 +12,34 @@ void takeblock(T); int takeintint(int (^C)(int)) { return C(4); } T somefunction() { - if (^{ }) - nothing(); + if (^{ }) + nothing(); - noop = ^{}; + noop = ^{}; - noop = ^{printf("\nClosure\n"); }; + noop = ^{printf("\nClosure\n"); }; - I(^{ }); + I(^{ }); - return ^{printf("\nClosure\n"); }; + return ^{printf("\nClosure\n"); }; } void test2() { - int x = 4; + int x = 4; - takeblock(^{ printf("%d\n", x); }); + takeblock(^{ printf("%d\n", x); }); while (1) { - takeblock(^{ - break; // expected-error {{'break' statement not in loop or switch statement}} - continue; // expected-error {{'continue' statement not in loop statement}} - while(1) break; // ok - goto foo; // expected-error {{goto not allowed}} - }); + takeblock(^{ + break; // expected-error {{'break' statement not in loop or switch statement}} + continue; // expected-error {{'continue' statement not in loop statement}} + while(1) break; // ok + goto foo; // expected-error {{goto not allowed}} + }); break; - } + } -foo: - takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}} + foo: + takeblock(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}} __block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}} takeblock(^{ y = 8; }); } @@ -59,11 +59,11 @@ void myfunc(int (^block)(int)) {} void myfunc3(const int *x); void test5() { - int a; + int a; - myfunc(^(int abcd) { - myfunc3(&a); - return 1; + myfunc(^(int abcd) { + myfunc3(&a); + return 1; }); } diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c index a9a7df61fe..8661fd8a52 100644 --- a/test/Sema/block-misc.c +++ b/test/Sema/block-misc.c @@ -4,37 +4,37 @@ void donotwarn(); int (^IFP) (); int (^II) (int); int test1() { - int (^PFR) (int) = 0; // OK - PFR = II; // OK + int (^PFR) (int) = 0; // OK + PFR = II; // OK - if (PFR == II) // OK + if (PFR == II) // OK donotwarn(); - if (PFR == IFP) // OK + if (PFR == IFP) // OK donotwarn(); if (PFR == (int (^) (int))IFP) // OK donotwarn(); - if (PFR == 0) // OK + if (PFR == 0) // OK donotwarn(); - if (PFR) // OK + if (PFR) // OK donotwarn(); - if (!PFR) // OK + if (!PFR) // OK donotwarn(); - return PFR != IFP; // OK + return PFR != IFP; // OK } int test2(double (^S)()) { double (^I)(int) = (void*) S; - (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} + (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} void *pv = I; - pv = S; + pv = S; I(1); @@ -114,7 +114,7 @@ void test11(int i) { void (^test12f)(void); void test12() { - test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}} + test12f = ^test12f; // expected-error {{type name requires a specifier or qualifier}} expected-error {{expected expression}} } // rdar://6808730 @@ -144,7 +144,7 @@ void foo(long (^comp)()) { void (^test15f)(void); void test15() { - foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}} + foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)', expected 'long (^)()'}} } __block int test16i; // expected-error {{__block attribute not allowed, only allowed on local variables}} diff --git a/test/Sema/block-printf-attribute-1.c b/test/Sema/block-printf-attribute-1.c index ce30b8e855..4941ae7bc6 100644 --- a/test/Sema/block-printf-attribute-1.c +++ b/test/Sema/block-printf-attribute-1.c @@ -1,15 +1,12 @@ // RUN: clang-cc %s -fsyntax-only -verify -fblocks -int main() -{ - void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}} - ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}} +int main() { + void (^b) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 3))) = // expected-error {{format argument not a string type}} + ^ __attribute__ ((__format__ (__printf__, 1, 3))) (int arg, const char * format, ...) {}; // expected-error {{format argument not a string type}} - void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {}; - - // FIXME: argument type poking not yet supportted. - z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */ - z(1, "%s", "HELLO"); // OK + void (^z) (int arg, const char * format, ...) __attribute__ ((__format__ (__printf__, 2, 3))) = ^ __attribute__ ((__format__ (__printf__, 2, 3))) (int arg, const char * format, ...) {}; + // FIXME: argument type poking not yet supportted. + z(1, "%s", 1); /* { dg-warning "format \\'\%s\\' expects type \\'char \\*\\'\, but argument 3 has type \\'int\\'" } */ + z(1, "%s", "HELLO"); // OK } - diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c index 96dde363de..98a72731d6 100644 --- a/test/Sema/block-return.c +++ b/test/Sema/block-return.c @@ -31,7 +31,7 @@ CL foo() { return (float)1.0; else if (2) - return (double)2.0; + return (double)2.0; return 1; }; char *(^B)(void) = ^{ @@ -66,7 +66,7 @@ int foo3() { Boolean (*value_equal)(uintptr_t, uintptr_t) = 0; cb.isEqual = ^(const CFBasicHash *table, uintptr_t stack_value_or_key1, uintptr_t stack_value_or_key2, Boolean is_key) { - return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2); + return (Boolean)(uintptr_t)INVOKE_CALLBACK2(value_equal, (uintptr_t)stack_value_or_key1, (uintptr_t)stack_value_or_key2); }; } diff --git a/test/Sema/block-sentinel-attribute.c b/test/Sema/block-sentinel-attribute.c index a7d4df108e..5628a2c780 100644 --- a/test/Sema/block-sentinel-attribute.c +++ b/test/Sema/block-sentinel-attribute.c @@ -2,24 +2,23 @@ void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1))); -int main() -{ - void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}} - void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}} - ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {}; - void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}} +int main() { + void (^bbad) (int arg, const char * format) __attribute__ ((__sentinel__)) ; // expected-warning {{sentinel' attribute only supported for variadic blocks}} + void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) = // expected-note {{block has been explicitly marked sentinel here}} + ^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {}; + void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}} - void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}} + void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {}; // expected-note {{block has been explicitly marked sentinel here}} - b(1, "%s", (void*)0); // OK - b(1, "%s", 0); // expected-warning {{missing sentinel in block call}} - z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}} - z(1, "%s", (void*)0, 1, 0); // OK + b(1, "%s", (void*)0); // OK + b(1, "%s", 0); // expected-warning {{missing sentinel in block call}} + z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in block call}} + z(1, "%s", (void*)0, 1, 0); // OK - y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}} + y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in block call}} - y(1, "%s", (void*)0,3,4,5,6,7); // OK + y(1, "%s", (void*)0,3,4,5,6,7); // OK } diff --git a/test/Sema/c89-2.c b/test/Sema/c89-2.c index 3b546404a9..50c5f4e5a8 100644 --- a/test/Sema/c89-2.c +++ b/test/Sema/c89-2.c @@ -1,5 +1,5 @@ /* RUN: clang-cc %s -std=c89 -pedantic-errors -verify */ -#if 1LL /* expected-error {{long long}} */ +#if 1LL /* expected-error {{long long}} */ #endif diff --git a/test/Sema/c89.c b/test/Sema/c89.c index 9bf720b6a3..fc50ebed66 100644 --- a/test/Sema/c89.c +++ b/test/Sema/c89.c @@ -25,7 +25,7 @@ void test3(int i) { int A[i]; /* expected-warning {{variable length array}} */ } -int test4 = 0LL; /* expected-warning {{long long}} */ +int test4 = 0LL; /* expected-warning {{long long}} */ /* PR1999 */ void test5(register); diff --git a/test/Sema/complex-int.c b/test/Sema/complex-int.c index 5977b4d1e0..6c660899e8 100644 --- a/test/Sema/complex-int.c +++ b/test/Sema/complex-int.c @@ -44,9 +44,8 @@ TestPairs(7); TestPairs(8); // rdar://6097730 void test3(_Complex int *x) { *x = ~*x; -} +} void test4(_Complex float *x) { *x = ~*x; -} - +} diff --git a/test/Sema/conditional.c b/test/Sema/conditional.c index 1c7486a613..9f48c349c9 100644 --- a/test/Sema/conditional.c +++ b/test/Sema/conditional.c @@ -4,12 +4,10 @@ const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r"; void _efree(void *ptr); -int _php_stream_free1() -{ - return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}} +int _php_stream_free1() { + return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}} } -int _php_stream_free2() -{ - return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}} +int _php_stream_free2() { + return (1 ? _efree(0) : free(0)); // expected-error {{incompatible type returning 'void', expected 'int'}} } diff --git a/test/Sema/darwin-align-cast.c b/test/Sema/darwin-align-cast.c index 313a9e3410..fed8983191 100644 --- a/test/Sema/darwin-align-cast.c +++ b/test/Sema/darwin-align-cast.c @@ -8,10 +8,10 @@ struct cmsghdr {}; #if 0 This code below comes from the following system headers: -sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct +sys/socket.h:#define CMSG_SPACE(l) (__DARWIN_ALIGN(sizeof(struct cmsghdr)) + __DARWIN_ALIGN(l)) -i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p) +i386/_param.h:#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) #endif diff --git a/test/Sema/floating-point-compare.c b/test/Sema/floating-point-compare.c index 763a8f4b86..9888105518 100644 --- a/test/Sema/floating-point-compare.c +++ b/test/Sema/floating-point-compare.c @@ -13,11 +13,11 @@ int f3(float x) { } int f4(float x) { - return x == 0.0; // no-warning {{comparing}} + return x == 0.0; // no-warning {{comparing}} } int f5(float x) { - return x == __builtin_inf(); // no-warning + return x == __builtin_inf(); // no-warning } int f7(float x) { diff --git a/test/Sema/function-pointer-sentinel-attribute.c b/test/Sema/function-pointer-sentinel-attribute.c index 0de02fa536..6d3fb17180 100644 --- a/test/Sema/function-pointer-sentinel-attribute.c +++ b/test/Sema/function-pointer-sentinel-attribute.c @@ -2,22 +2,19 @@ void (*e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1))); -int main() -{ - void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}} - void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}} +int main() { + void (*b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)); // expected-note {{function has been explicitly marked sentinel here}} + void (*z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))); // expected-note {{function has been explicitly marked sentinel here}} - void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}} + void (*y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))); // expected-note {{function has been explicitly marked sentinel here}} - b(1, "%s", (void*)0); // OK - b(1, "%s", 0); // expected-warning {{missing sentinel in function call}} - z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}} - z(1, "%s", (void*)0, 1, 0); // OK + b(1, "%s", (void*)0); // OK + b(1, "%s", 0); // expected-warning {{missing sentinel in function call}} + z(1, "%s",4 ,1,0); // expected-warning {{missing sentinel in function call}} + z(1, "%s", (void*)0, 1, 0); // OK - y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} - - y(1, "%s", (void*)0,3,4,5,6,7); // OK + y(1, "%s", 1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} + y(1, "%s", (void*)0,3,4,5,6,7); // OK } - diff --git a/test/Sema/function-sentinel-attr.c b/test/Sema/function-sentinel-attr.c index 6630479612..b33b4a063c 100644 --- a/test/Sema/function-sentinel-attr.c +++ b/test/Sema/function-sentinel-attr.c @@ -18,7 +18,7 @@ int main () foo1(1, 0) ; // expected-warning {{missing sentinel in function call}} foo5(1, NULL, 2); // OK foo5(1,2,NULL, 1); // OK - foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}} + foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}} foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} foo6(1,NULL,3,4,5,6,7); // OK diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c index 1a81cc55b5..5190bdbf93 100644 --- a/test/Sema/implicit-int.c +++ b/test/Sema/implicit-int.c @@ -12,15 +12,15 @@ void f((x)); // expected-warning {{type specifier missing, defaults to 'int'}} // PR3702 #define PAD(ms10) { \ - register i; \ + register i; \ } -#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */ +#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */ void h19_insline(n) // expected-warning {{parameter 'n' was not declared, defaulting to type 'int'}} { - ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}} + ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}} } struct foo { diff --git a/test/Sema/predefined-function.c b/test/Sema/predefined-function.c index e8ccb3636b..c8d17f0078 100644 --- a/test/Sema/predefined-function.c +++ b/test/Sema/predefined-function.c @@ -8,31 +8,30 @@ int eli(float b); // expected-note {{previous declaration is here}} int b(int c) {return 1;} int foo(); -int foo() -{ - int eli(int (int)); // expected-error {{conflicting types for 'eli'}} - eli(b); // expected-error{{incompatible type passing}} - return 0; +int foo() { + int eli(int (int)); // expected-error {{conflicting types for 'eli'}} + eli(b); // expected-error{{incompatible type passing}} + return 0; } int bar(); int bar(int i) // expected-note {{previous definition is here}} { - return 0; + return 0; } int bar() // expected-error {{redefinition of 'bar'}} { - return 0; + return 0; } int foobar(int); // note {{previous declaration is here}} int foobar() // error {{conflicting types for 'foobar'}} { - return 0; + return 0; } int wibble(); // expected-note {{previous declaration is here}} float wibble() // expected-error {{conflicting types for 'wibble'}} { - return 0.0f; + return 0.0f; } diff --git a/test/Sema/static-init.c b/test/Sema/static-init.c index cd495568ca..510f3ab099 100644 --- a/test/Sema/static-init.c +++ b/test/Sema/static-init.c @@ -11,11 +11,11 @@ _Bool t = &t; union bar { - int i; + int i; }; struct foo { - unsigned ptr; + unsigned ptr; }; union bar u[1]; diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c index 2c0945f9f8..a5a299bf09 100644 --- a/test/Sema/struct-decl.c +++ b/test/Sema/struct-decl.c @@ -1,26 +1,26 @@ // RUN: clang-cc -fsyntax-only -verify %s // PR3459 struct bar { - char n[1]; + char n[1]; }; struct foo { - char name[(int)&((struct bar *)0)->n]; - char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}} + char name[(int)&((struct bar *)0)->n]; + char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}} }; // PR3430 struct s { - struct st { - int v; - } *ts; + struct st { + int v; + } *ts; }; struct st; int foo() { - struct st *f; - return f->v + f[0].v; + struct st *f; + return f->v + f[0].v; } // PR3642, PR3671 @@ -29,8 +29,8 @@ struct pppoe_tag { char tag_data[]; }; struct datatag { - struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}} - char data; + struct pppoe_tag hdr; //expected-warning{{field 'hdr' with variable sized type 'struct pppoe_tag' not at the end of a struct or class is a GNU extension}} + char data; }; diff --git a/test/Sema/transparent-union-pointer.c b/test/Sema/transparent-union-pointer.c index ea761f17e7..a58bd42f82 100644 --- a/test/Sema/transparent-union-pointer.c +++ b/test/Sema/transparent-union-pointer.c @@ -1,14 +1,14 @@ // RUN: clang-cc %s -fsyntax-only -verify typedef union { - union wait *__uptr; - int *__iptr; + union wait *__uptr; + int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); extern int wait (__WAIT_STATUS __stat_loc); void fastcgi_cleanup() { - int status = 0; - wait(&status); + int status = 0; + wait(&status); } |