summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tls/init-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/tls/init-2.C')
-rw-r--r--gcc/testsuite/g++.dg/tls/init-2.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/tls/init-2.C b/gcc/testsuite/g++.dg/tls/init-2.C
new file mode 100644
index 000000000..c9f646d3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tls/init-2.C
@@ -0,0 +1,14 @@
+/* Invalid initializations. */
+/* { dg-require-effective-target tls } */
+
+extern __thread int i;
+__thread int *p = &i; /* { dg-error "dynamically initialized" } */
+
+extern int f();
+__thread int j = f(); /* { dg-error "dynamically initialized" } */
+
+struct S
+{
+ S();
+};
+__thread S s; /* { dg-error "" } two errors here */