aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-06-30 11:00:32 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-06-30 11:00:32 +0000
commit8a36714a1b9855a1a0d99fe162947258c7ecd674 (patch)
treea89f71d09711a34b193026e0ad4127a399180399 /gcc
parenta4398a300ed00d842f9786d529a7a4b0fce6e634 (diff)
downloadgcc-8a36714a1b9855a1a0d99fe162947258c7ecd674.zip
gcc-8a36714a1b9855a1a0d99fe162947258c7ecd674.tar.gz
gcc-8a36714a1b9855a1a0d99fe162947258c7ecd674.tar.bz2
Add parloops-exit-first-loop-alt-{5,6,7}.c
2015-06-30 Tom de Vries <tom@codesourcery.com> * gcc.dg/parloops-exit-first-loop-alt-5.c: New test. * gcc.dg/parloops-exit-first-loop-alt-6.c: New test. * gcc.dg/parloops-exit-first-loop-alt-7.c: New test. * gcc.dg/parloops-exit-first-loop-alt.c: Update comment. * testsuite/libgomp.c/parloops-exit-first-loop-alt-5.c: New test. * testsuite/libgomp.c/parloops-exit-first-loop-alt-6.c: New test. * testsuite/libgomp.c/parloops-exit-first-loop-alt-7.c: New test. * testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Update comment. From-SVN: r225172
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-5.c22
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-6.c22
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-7.c22
-rw-r--r--gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt.c2
5 files changed, 74 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b006b4c..8716cd3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-30 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/parloops-exit-first-loop-alt-5.c: New test.
+ * gcc.dg/parloops-exit-first-loop-alt-6.c: New test.
+ * gcc.dg/parloops-exit-first-loop-alt-7.c: New test.
+ * gcc.dg/parloops-exit-first-loop-alt.c: Update comment.
+
2015-06-30 Marek Polacek <polacek@redhat.com>
* gcc.dg/fold-ior-2.c: New test.
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-5.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-5.c
new file mode 100644
index 0000000..3f799cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-5.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+
+/* Variable bound, vector addition, unsigned loop counter, unsigned bound. */
+
+void
+f (unsigned int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
+ unsigned int *__restrict__ c)
+{
+ unsigned int i;
+
+ for (i = 0; i < n; ++i)
+ c[i] = a[i] + b[i];
+}
+
+/* Three times a store:
+ - 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)^ \\*_\[0-9\]*" 3 "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-6.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-6.c
new file mode 100644
index 0000000..ee19a55
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-6.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+
+/* Variable bound, vector addition, unsigned loop counter, signed bound. */
+
+void
+f (int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
+ unsigned int *__restrict__ c)
+{
+ unsigned int i;
+
+ for (i = 0; i < n; ++i)
+ c[i] = a[i] + b[i];
+}
+
+/* Three times a store:
+ - 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)^ \\*_\[0-9\]*" 3 "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-7.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-7.c
new file mode 100644
index 0000000..c337342
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt-7.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
+
+/* Variable bound, vector addition, signed loop counter, signed bound. */
+
+void
+f (int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
+ unsigned int *__restrict__ c)
+{
+ int i;
+
+ for (i = 0; i < n; ++i)
+ c[i] = a[i] + b[i];
+}
+
+/* Three times a store:
+ - 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)^ \\*_\[0-9\]*" 3 "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt.c b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt.c
index e088fa1..0b69165 100644
--- a/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt.c
+++ b/gcc/testsuite/gcc.dg/parloops-exit-first-loop-alt.c
@@ -2,7 +2,7 @@
/* { dg-require-effective-target pthread } */
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
-/* Variable bound, vector addition. */
+/* Variable bound, vector addition, signed loop counter, unsigned bound. */
void
f (unsigned int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,