summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/loop-8.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c/loop-8.c')
-rw-r--r--libgomp/testsuite/libgomp.c/loop-8.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/loop-8.c b/libgomp/testsuite/libgomp.c/loop-8.c
new file mode 100644
index 000000000..25db25c3b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/loop-8.c
@@ -0,0 +1,27 @@
+extern void abort (void);
+
+int buf[256];
+
+void __attribute__((noinline))
+foo (void)
+{
+ int i;
+ #pragma omp for schedule (auto)
+ for (i = 0; i < 256; i++)
+ buf[i] += i;
+}
+
+int
+main (void)
+{
+ int i;
+ #pragma omp parallel for schedule (auto)
+ for (i = 0; i < 256; i++)
+ buf[i] = i;
+ #pragma omp parallel num_threads (4)
+ foo ();
+ for (i = 0; i < 256; i++)
+ if (buf[i] != 2 * i)
+ abort ();
+ return 0;
+}