summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/tls-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/tls-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/tls-1.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/tls-1.c b/gcc/testsuite/gcc.dg/gomp/tls-1.c
new file mode 100644
index 00000000000..9dc102e7e61
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/tls-1.c
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-require-effective-target tls }
+
+int tp1;
+static int tp2;
+extern int tp3;
+
+int tp4 = 1;
+static int tp5 = 1;
+
+#pragma omp threadprivate (tp1, tp2, tp3, tp4, tp5)
+
+#pragma omp threadprivate (undef) // { dg-error "undeclared" }
+
+int tp6;
+int foo(void) { return tp6; }
+
+#pragma omp threadprivate (tp6) // { dg-error "after first use" }