aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-11-30 17:48:41 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-11-30 17:48:41 +0000
commit522cdabdeae7c2e3374d5b1c6d780ec3506dfbfd (patch)
tree039fa582b4e26f0e49843aaf41e6e4b3136ddb58 /gcc
parent34ea150cdc6e60203ebd073f7895461c8d2002d8 (diff)
downloadgcc-522cdabdeae7c2e3374d5b1c6d780ec3506dfbfd.zip
gcc-522cdabdeae7c2e3374d5b1c6d780ec3506dfbfd.tar.gz
gcc-522cdabdeae7c2e3374d5b1c6d780ec3506dfbfd.tar.bz2
Add gcc.dg/pr46032-{2,3}.c test-cases
2015-11-30 Tom de Vries <tom@codesourcery.com> * gcc.dg/pr46032-2.c: New test. * gcc.dg/pr46032-3.c: New test. From-SVN: r231079
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr46032-2.c29
-rw-r--r--gcc/testsuite/gcc.dg/pr46032-3.c28
3 files changed, 62 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e2355f5..466d357 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-30 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/pr46032-2.c: New test.
+ * gcc.dg/pr46032-3.c: New test.
+
2015-11-30 Charles Baylis <charles.baylis@linaro.org>
PR target/63870
diff --git a/gcc/testsuite/gcc.dg/pr46032-2.c b/gcc/testsuite/gcc.dg/pr46032-2.c
new file mode 100644
index 0000000..e110880
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46032-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+
+#define N 2
+
+int
+foo (void)
+{
+ int a[N], b[N], c[N];
+ int *ap = &a[0];
+ int *bp = &b[0];
+ int *cp = &c[0];
+
+#pragma omp parallel for
+ for (unsigned int idx = 0; idx < N; idx++)
+ {
+ ap[idx] = 1;
+ bp[idx] = 2;
+ cp[idx] = ap[idx];
+ }
+
+ return *cp;
+}
+
+/* { dg-final { scan-tree-dump-times "\\] = 1;" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/pr46032-3.c b/gcc/testsuite/gcc.dg/pr46032-3.c
new file mode 100644
index 0000000..a4af7ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46032-3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -std=c99 -fipa-pta -fdump-tree-optimized" } */
+
+#define N 2
+
+int
+foo (void)
+{
+ int a[N], c[N];
+ int *ap = &a[0];
+ int *bp = &a[0];
+ int *cp = &c[0];
+
+#pragma omp parallel for
+ for (unsigned int idx = 0; idx < N; idx++)
+ {
+ ap[idx] = 1;
+ bp[idx] = 2;
+ cp[idx] = ap[idx];
+ }
+
+ return *cp;
+}
+
+/* { dg-final { scan-tree-dump-times "\\] = 1;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = 2;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = _\[0-9\]*;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\] = " 3 "optimized" } } */