| 1 |
/* Test for _Thread_local in C11. Test of valid code. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=c11 -pedantic-errors" } */ |
| 4 |
|
| 5 |
_Thread_local int a; |
| 6 |
static _Thread_local long b; |
| 7 |
extern _Thread_local int c, a; |
| 8 |
_Thread_local static int d; |
| 9 |
long _Thread_local extern b; |
| 10 |
_Thread_local int extern a; |
| 11 |
_Thread_local struct s; /* { dg-warning "useless" } */ |
| 12 |
_Thread_local int a = 1; |
| 13 |
extern _Thread_local int c = 2; /* { dg-warning "initialized and" } */ |
| 14 |
void |
| 15 |
f (void) |
| 16 |
{ |
| 17 |
static _Thread_local int x; |
| 18 |
extern _Thread_local long b; |
| 19 |
_Thread_local extern int a; |
| 20 |
} |
| 21 |
|
| 22 |
inline void |
| 23 |
fi (void) |
| 24 |
{ |
| 25 |
static _Thread_local const int v; |
| 26 |
(void) a; |
| 27 |
static _Thread_local int (*const p)[a]; |
| 28 |
} |