summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c')
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c
new file mode 100644
index 00000000000..2ea097d06f9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-pr66652.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+
+unsigned int
+f (unsigned int n, unsigned int sum)
+{
+ unsigned int i;
+
+ i = UINT_MAX;
+ do
+ {
+ sum += i % 13;
+ i++;
+ }
+ while (i < n - 1);
+
+ return sum;
+}
+
+/* Four times % 13:
+ - once in f._loopfn.0
+ - once in the parallel
+ - once in the low iteration count loop
+ - once for a peeled off last iteration following the parallel.
+ In other words, we want try_transform_to_exit_first_loop_alt to fail. */
+/* { dg-final { scan-tree-dump-times "(?n)% 13" 4 "parloops" } } */