Eli Friedman | 4fb71b0 | 2009-04-19 21:48:33 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -triple i686-pc-linux-gnu -fsyntax-only -verify %s |
Eli Friedman | f22f77f | 2009-04-19 20:29:08 +0000 | [diff] [blame] | 2 | |
| 3 | __thread int t1; |
| 4 | __thread extern int t2; |
| 5 | __thread static int t3; |
| 6 | __thread __private_extern__ int t4; |
| 7 | struct t5 { __thread int x; }; // expected-error {{type name does not allow storage class to be specified}} |
| 8 | __thread int t6(); // expected-error {{'__thread' is only allowed on variable declarations}} |
| 9 | int f(__thread int t7) { // expected-error {{'__thread' is only allowed on variable declarations}} |
| 10 | __thread int t8; // expected-error {{'__thread' variables must have global storage}} |
| 11 | __thread extern int t9; |
| 12 | __thread static int t10; |
| 13 | __thread __private_extern__ int t11; |
| 14 | __thread auto int t12; // expected-error {{'__thread' variables must have global storage}} |
| 15 | __thread register int t13; // expected-error {{'__thread' variables must have global storage}} |
| 16 | } |
| 17 | __thread typedef int t14; // expected-error {{'__thread' is only allowed on variable declarations}} |
| 18 | __thread int t15; // expected-note {{[previous definition is here}} |
| 19 | int t15; // expected-error {{non-thread-local declaration of 't15' follows thread-local declaration}} |
| 20 | int t16; // expected-note {{[previous definition is here}} |
| 21 | __thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}} |