summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/loop-3.C
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/loop-3.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/loop-3.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/loop-3.C b/libgomp/testsuite/libgomp.c++/loop-3.C
new file mode 100644
index 000000000..fa50f099f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/loop-3.C
@@ -0,0 +1,26 @@
+extern "C" void abort (void);
+int a;
+
+void
+foo ()
+{
+ int i;
+ a = 30;
+#pragma omp barrier
+#pragma omp for lastprivate (a)
+ for (i = 0; i < 1024; i++)
+ {
+ a = i;
+ }
+ if (a != 1023)
+ abort ();
+}
+
+int
+main (void)
+{
+#pragma omp parallel num_threads (64)
+ foo ();
+
+ return 0;
+}