summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/tls/init-2.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/tls/init-2.m')
-rw-r--r--gcc/testsuite/objc.dg/tls/init-2.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/tls/init-2.m b/gcc/testsuite/objc.dg/tls/init-2.m
new file mode 100644
index 000000000..882e5f809
--- /dev/null
+++ b/gcc/testsuite/objc.dg/tls/init-2.m
@@ -0,0 +1,14 @@
+/* Invalid initializations. */
+/* { dg-require-effective-target tls } */
+
+extern __thread int i;
+__thread int *p = &i; /* { dg-error "initializer element is not constant" } */
+
+extern int f();
+__thread int j = f(); /* { dg-error "initializer element is not constant" } */
+
+struct S
+{
+ S(); /* { dg-error "expected specifier-qualifier-list before 'S'" } */
+};
+__thread S s; /* { dg-error "unknown type name" } */