summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/loop-6.C
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/loop-6.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/loop-6.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/loop-6.C b/libgomp/testsuite/libgomp.c++/loop-6.C
new file mode 100644
index 000000000..f4a6925a4
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/loop-6.C
@@ -0,0 +1,25 @@
+// { dg-do run }
+
+extern "C" void abort (void);
+
+volatile int count;
+static int test(void)
+{
+ return ++count > 0;
+}
+
+int i;
+
+int main()
+{
+ #pragma omp for lastprivate (i)
+ for (i = 0; i < 10; ++i)
+ {
+ if (test())
+ continue;
+ abort ();
+ }
+ if (i != count)
+ abort ();
+ return 0;
+}