summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/pr35751.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/pr35751.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr35751.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/pr35751.c b/gcc/testsuite/gcc.dg/gomp/pr35751.c
new file mode 100644
index 000000000..f7777a5b7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr35751.c
@@ -0,0 +1,34 @@
+/* PR c/35751 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (int i)
+{
+ extern int a[i]; /* { dg-error "must have no linkage|storage size of" } */
+ static int b[i]; /* { dg-error "storage size of" } */
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}