1 /* Test for _Thread_local in C11. Test of invalid code. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors" } */
5 _Thread_local
void f (void); /* { dg-error "storage class" } */
6 _Thread_local
void g (void) {} /* { dg-error "_Thread_local" } */
7 typedef _Thread_local
int t1
; /* { dg-error "_Thread_local" } */
8 _Thread_local
typedef int t2
; /* { dg-error "_Thread_local" } */
13 _Thread_local
auto int a
; /* { dg-error "_Thread_local" } */
14 _Thread_local
register int b
; /* { dg-error "_Thread_local" } */
15 auto _Thread_local
int c
; /* { dg-error "_Thread_local" } */
16 register _Thread_local
int d
; /* { dg-error "_Thread_local" } */
17 _Thread_local
int e
; /* { dg-error "_Thread_local" } */
20 _Thread_local
int v
; /* { dg-message "previous" } */
21 extern int v
; /* { dg-error "thread" } */
22 int w
; /* { dg-message "previous" } */
23 extern _Thread_local
int w
; /* { dg-error "thread" } */
25 _Thread_local
int x
; /* { dg-message "previous" } */
26 int y
; /* { dg-message "previous" } */
33 extern int x
; /* { dg-error "thread" } */
34 extern _Thread_local
int y
; /* { dg-error "thread" } */
35 static _Thread_local
int a
[vv
]; /* { dg-error "storage size" } */
36 static _Thread_local
int vi
= vv
; /* { dg-error "not constant" } */
39 static _Thread_local
int sv
;
44 static _Thread_local
int vj
; /* { dg-error "static but declared" } */
45 (void) sv
; /* { dg-error "static but used in inline" } */