summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/sharing-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/sharing-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/sharing-2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/sharing-2.c b/gcc/testsuite/gcc.dg/gomp/sharing-2.c
new file mode 100644
index 000000000..33bbb3bad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/sharing-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ int i;
+ int a[10];
+ #pragma omp parallel private (i) shared (a)
+ {
+ i = 1;
+ #pragma omp parallel shared (a, i)
+ {
+ #pragma omp master
+ i = 2;
+ #pragma omp parallel private (i) shared (a)
+ {
+ for (i = 0; i < 10; i++)
+ a[i] = i + 1;
+ }
+ #pragma omp master
+ i = 3;
+ }
+ i = 4;
+ }
+}