gcc/testsuite/obj-c++.dg/tls/init-1.mm
raw| 1 | /* Invalid initializations. */ |
| 2 | /* { dg-require-effective-target tls } */ |
| 3 | |
| 4 | __thread int i = 42; |
| 5 | |
| 6 | static int j; |
| 7 | __thread int *p = &j; |
| 8 | |
| 9 | /* Note that this is valid in C++ (unlike C) as a run-time initialization. */ |
| 10 | int *q = &i; |
| 11 | |
| 12 | /* Valid because "const int k" is an integral constant expression in C++. */ |
| 13 | __thread const int k = 42; |
| 14 | __thread const int l = k; |