summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
new file mode 100644
index 00000000000..b655edc107c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -std=c99" } */
+
+int a;
+void
+g (int k)
+{
+ a = k; /* The global "a", not the private "a" in f */
+}
+
+void
+f (int n)
+{
+ int a = 0;
+#pragma omp parallel for private(a)
+ for (int i = 1; i < n; i++)
+ {
+ a = i;
+ g (a * 2); /* Private copy of "a" */
+ }
+}