aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm')
-rw-r--r--gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm b/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm
new file mode 100644
index 000000000..22c2395ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/obj-c++.dg/tls/diag-3.mm
@@ -0,0 +1,11 @@
+/* Report invalid extern and __thread combinations. */
+/* { dg-require-effective-target tls } */
+
+extern int j; /* { dg-message "previously declared here" } */
+__thread int j; /* { dg-error "follows non-thread-local" } */
+
+extern __thread int i; /* { dg-message "previously declared here" } */
+int i; /* { dg-error "follows thread-local" } */
+
+extern __thread int k; /* This is fine. */
+__thread int k;