summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/loop-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c/loop-4.c')
-rw-r--r--libgomp/testsuite/libgomp.c/loop-4.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/loop-4.c b/libgomp/testsuite/libgomp.c/loop-4.c
new file mode 100644
index 000000000..bc57c043a
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/loop-4.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int
+main (void)
+{
+ int e = 0;
+#pragma omp parallel num_threads (4) reduction(+:e)
+ {
+ long i;
+ #pragma omp for schedule(dynamic,1)
+ for (i = __LONG_MAX__ - 30001; i <= __LONG_MAX__ - 10001; i += 10000)
+ if (i != __LONG_MAX__ - 30001
+ && i != __LONG_MAX__ - 20001
+ && i != __LONG_MAX__ - 10001)
+ e = 1;
+ #pragma omp for schedule(dynamic,1)
+ for (i = -__LONG_MAX__ + 30000; i >= -__LONG_MAX__ + 10000; i -= 10000)
+ if (i != -__LONG_MAX__ + 30000
+ && i != -__LONG_MAX__ + 20000
+ && i != -__LONG_MAX__ + 10000)
+ e = 1;
+ }
+ if (e)
+ abort ();
+ return 0;
+}