diff options
Diffstat (limited to 'clang/test/Sema')
-rw-r--r-- | clang/test/Sema/address_spaces.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/block-literal.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/implicit-int.c | 10 | ||||
-rw-r--r-- | clang/test/Sema/invalid-decl.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/invalid-struct-init.c | 5 |
5 files changed, 15 insertions, 6 deletions
diff --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c index 8900b08b0d3..a081b38a8eb 100644 --- a/clang/test/Sema/address_spaces.c +++ b/clang/test/Sema/address_spaces.c @@ -5,7 +5,7 @@ #define _AS3 __attribute__((address_space(3))) void foo(_AS3 float *a) { - _AS2 *x; + _AS2 *x;// expected-warning {{type specifier missing, defaults to 'int'}} _AS1 float * _AS2 *B; int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}} diff --git a/clang/test/Sema/block-literal.c b/clang/test/Sema/block-literal.c index d5d41abb6cb..7f64c03c1bb 100644 --- a/clang/test/Sema/block-literal.c +++ b/clang/test/Sema/block-literal.c @@ -40,7 +40,7 @@ void test2() { foo: takeclosure(^{ x = 4; }); // expected-error {{variable is not assignable (missing __block type specifier)}} - __block y = 7; + __block y = 7; // expected-warning {{type specifier missing, defaults to 'int'}} takeclosure(^{ y = 8; }); } diff --git a/clang/test/Sema/implicit-int.c b/clang/test/Sema/implicit-int.c index e4a215fb78f..f15a40fa083 100644 --- a/clang/test/Sema/implicit-int.c +++ b/clang/test/Sema/implicit-int.c @@ -1,4 +1,10 @@ -// RUN: clang -fsyntax-only %s +// RUN: clang -fsyntax-only %s -verify -pedantic -foo() { +foo() { // expected-warning {{type specifier missing, defaults to 'int'}} } + +y; // expected-warning {{type specifier missing, defaults to 'int'}} + +// rdar://6131634 +void f((x)); // expected-warning {{type specifier missing, defaults to 'int'}} + diff --git a/clang/test/Sema/invalid-decl.c b/clang/test/Sema/invalid-decl.c index efc199d39b0..17f316884ee 100644 --- a/clang/test/Sema/invalid-decl.c +++ b/clang/test/Sema/invalid-decl.c @@ -6,7 +6,7 @@ void test() { // PR2400 -typedef xtype (*zend_stream_fsizer_t)(void* handle); // expected-error {{function cannot return array or function type}} +typedef xtype (*zend_stream_fsizer_t)(void* handle); // expected-error {{function cannot return array or function type}} expected-warning {{type specifier missing, defaults to 'int'}} expected-warning {{type specifier missing, defaults to 'int'}} typedef struct _zend_module_entry zend_module_entry; struct _zend_module_entry { diff --git a/clang/test/Sema/invalid-struct-init.c b/clang/test/Sema/invalid-struct-init.c index fb965926943..9777a27a0ed 100644 --- a/clang/test/Sema/invalid-struct-init.c +++ b/clang/test/Sema/invalid-struct-init.c @@ -3,7 +3,10 @@ typedef struct _zend_module_entry zend_module_entry; struct _zend_module_entry { _efree((p)); // expected-error{{type name requires a specifier or qualifier}} \ - // expected-error{{field '_efree' declared as a function}} + expected-error{{field '_efree' declared as a function}} \ + expected-warning {{type specifier missing, defaults to 'int'}} \ + expected-warning {{type specifier missing, defaults to 'int'}} + }; typedef struct _zend_function_entry { } zend_function_entry; typedef struct _zend_pcre_globals { } zend_pcre_globals; |