blob: ed27c7063df70d5509f038782145b230da609fff [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s
Eli Friedmanf22f77f2009-04-19 20:29:08 +00002
3__thread int t1;
4__thread extern int t2;
5__thread static int t3;
6__thread __private_extern__ int t4;
7struct 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}}
9int 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}}
19int t15; // expected-error {{non-thread-local declaration of 't15' follows thread-local declaration}}
20int t16; // expected-note {{[previous definition is here}}
21__thread int t16; // expected-error {{thread-local declaration of 't16' follows non-thread-local declaration}}