From 522cdabdeae7c2e3374d5b1c6d780ec3506dfbfd Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 30 Nov 2015 17:48:41 +0000 Subject: [PATCH] Add gcc.dg/pr46032-{2,3}.c test-cases 2015-11-30 Tom de Vries * gcc.dg/pr46032-2.c: New test. * gcc.dg/pr46032-3.c: New test. From-SVN: r231079 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr46032-2.c | 29 +++++++++++++++++++++++++++++ gcc/testsuite/gcc.dg/pr46032-3.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr46032-2.c create mode 100644 gcc/testsuite/gcc.dg/pr46032-3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2355f5ea50..466d357a59a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-30 Tom de Vries + + * gcc.dg/pr46032-2.c: New test. + * gcc.dg/pr46032-3.c: New test. + 2015-11-30 Charles Baylis 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 00000000000..e110880bd8e --- /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 00000000000..a4af7ec4a8a --- /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" } } */ -- 2.11.4.GIT