aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tls/init-1.C
blob: 97867123a95f70f0aab0c8c10b46dea0b0d095cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Valid initializations.  */
/* { dg-require-effective-target tls } */

__thread int i = 42;

static int j;
__thread int *p = &j;

/* Note that this is valid in C++ (unlike C) as a run-time initialization.  */
int *q = &i;

/* Valid because "const int k" is an integral constant expression in C++.  */
__thread const int k = 42;
__thread const int l = k;