thread-specifier.c revision 2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc
1// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fsyntax-only -verify %s 2 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}} 22