aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm
new file mode 100644
index 000000000..943088713
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/init-1.mm
@@ -0,0 +1,14 @@
+/* Invalid 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; \ No newline at end of file