summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/tls/diag-3.m
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/objc.dg/tls/diag-3.m')
-rw-r--r--gcc/testsuite/objc.dg/tls/diag-3.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/tls/diag-3.m b/gcc/testsuite/objc.dg/tls/diag-3.m
new file mode 100644
index 000000000..c71f66fb8
--- /dev/null
+++ b/gcc/testsuite/objc.dg/tls/diag-3.m
@@ -0,0 +1,11 @@
+/* Report invalid extern and __thread combinations. */
+/* { dg-require-effective-target tls } */
+
+extern int j; /* { dg-message "previous declaration of 'j' was here" } */
+__thread int j; /* { dg-error "follows non-thread-local" } */
+
+extern __thread int i; /* { dg-message "previous declaration of 'i' was here" } */
+int i; /* { dg-error "follows thread-local" } */
+
+extern __thread int k; /* This is fine. */
+__thread int k;