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