aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-06-13 08:05:54 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-06-13 08:05:54 +0000
commita6860be9c89b7025c938f7a53c209478d3d84ca9 (patch)
tree36fd31ec1cf7c4432aa7fde0ccad445724213a8b /gcc
parentab3306d23cc57c61e1f1ec7489b2f1ca556a1b87 (diff)
downloadgcc-a6860be9c89b7025c938f7a53c209478d3d84ca9.zip
gcc-a6860be9c89b7025c938f7a53c209478d3d84ca9.tar.gz
gcc-a6860be9c89b7025c938f7a53c209478d3d84ca9.tar.bz2
Add gcc.dg/parloops-exit-first-loop-alt-4.c
2015-06-13 Tom de Vries <tom@codesourcery.com> * gcc.dg/parloops-exit-first-loop-alt-4.c: New test. * testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: New test. From-SVN: r224453
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-4.c28
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 03c3c7c..35822f3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2015-06-13 Tom de Vries <tom@codesourcery.com>
+ * gcc.dg/parloops-exit-first-loop-alt-4.c: New test.
+
+2015-06-13 Tom de Vries <tom@codesourcery.com>
+
* gcc.dg/parloops-exit-first-loop-alt-2.c: Add comment.
(main): Remove superfluous attributes.
* gcc.dg/parloops-exit-first-loop-alt-3.c: Same.
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-4.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-4.c
new file mode 100644
index 0000000..2b8d289
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+
+/* Constant bound, reduction. */
+
+#define N 4000
+
+unsigned int *a;
+
+unsigned int
+f (void)
+{
+ int i;
+ unsigned int sum = 1;
+
+ for (i = 0; i < N; ++i)
+ sum += a[i];
+
+ return sum;
+}
+
+/* Three array accesses:
+ - one in f._loopfn.0
+ - one in the parallel
+ - one in the low iteration count loop
+ Crucially, none for a peeled off last iteration following the parallel. */
+/* { dg-final { scan-tree-dump-times "(?n)\\\* 4" 3 "parloops" } } */