From 3f73d6ef90458b45bbbb33ef4c2b174d4662a22d Mon Sep 17 00:00:00 2001 From: Jing Yu Date: Wed, 15 Feb 2012 15:40:16 -0800 Subject: Sync down FSF r184235@google/gcc-4_6_2-mobile branch 1) Get mostly new patches from FSF gcc-4.6 branch 2) Fix PR52129 3) Insert GNU-stack note for all ARM targets Change-Id: I2b9926981210e517e4021242908074319a91d6bd --- gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c | 31 ++++++++++++++++++++++ gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c | 25 +++++++++++++++++ gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c | 26 ++++++++++++++++++ gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c | 18 +++++++++++++ .../testsuite/libgomp.fortran/pr49792-1.f90 | 18 +++++++++++++ .../testsuite/libgomp.fortran/pr49792-2.f90 | 22 +++++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-1.f90 create mode 100644 gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-2.f90 (limited to 'gcc-4.6/libgomp/testsuite') diff --git a/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c new file mode 100644 index 000000000..d21a26252 --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c @@ -0,0 +1,31 @@ +/* PR middle-end/49897 */ +/* { dg-do run } */ + +extern void abort (void); + +int +main () +{ + int i, j, x = 0, y, sum = 0; +#pragma omp parallel reduction(+:sum) + { + #pragma omp for firstprivate(x) lastprivate(x, y) + for (i = 0; i < 10; i++) + { + x = i; + y = 0; + #pragma omp parallel reduction(+:sum) + { + #pragma omp for firstprivate(y) lastprivate(y) + for (j = 0; j < 10; j++) + { + y = j; + sum += y; + } + } + } + } + if (x != 9 || y != 9 || sum != 450) + abort (); + return 0; +} diff --git a/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c new file mode 100644 index 000000000..c9ea5eced --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c @@ -0,0 +1,25 @@ +/* PR middle-end/49897 */ +/* { dg-do run } */ + +extern void abort (void); + +int +main () +{ + int i, j, x = 0, y, sum = 0; +#pragma omp parallel for reduction(+:sum) firstprivate(x) lastprivate(x, y) + for (i = 0; i < 10; i++) + { + x = i; + y = 0; + #pragma omp parallel for reduction(+:sum) firstprivate(y) lastprivate(y) + for (j = 0; j < 10; j++) + { + y = j; + sum += y; + } + } + if (x != 9 || y != 9 || sum != 450) + abort (); + return 0; +} diff --git a/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c new file mode 100644 index 000000000..175426d40 --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c @@ -0,0 +1,26 @@ +/* PR middle-end/49898 */ +/* { dg-do run } */ + +extern void abort (void); + +int +main () +{ + int i, j, sum = 0; +#pragma omp parallel + { + #pragma omp for reduction(+:sum) + for (i = 0; i < 10; i++) + { + #pragma omp parallel + { + #pragma omp for reduction(+:sum) + for (j = 0; j < 10; j++) + sum += j; + } + } + } + if (sum != 450) + abort (); + return 0; +} diff --git a/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c new file mode 100644 index 000000000..03ba0f8ff --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c @@ -0,0 +1,18 @@ +/* PR middle-end/49898 */ +/* { dg-do run } */ + +extern void abort (void); + +int +main () +{ + int i, j, sum = 0; +#pragma omp parallel for reduction(+:sum) + for (i = 0; i < 10; i++) + #pragma omp parallel for reduction(+:sum) + for (j = 0; j < 10; j++) + sum += j; + if (sum != 450) + abort (); + return 0; +} diff --git a/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-1.f90 b/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-1.f90 new file mode 100644 index 000000000..cf2bb66fc --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-1.f90 @@ -0,0 +1,18 @@ +! PR fortran/49792 +! { dg-do run } + +subroutine reverse(n, a) + integer :: n + real(kind=8) :: a(n) +!$omp parallel workshare + a(:) = a(n:1:-1) +!$omp end parallel workshare +end subroutine reverse + +program pr49792 + real(kind=8) :: a(16) = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] + real(kind=8) :: b(16) + b(:) = a(16:1:-1) + call reverse (16,a) + if (any (a.ne.b)) call abort +end program pr49792 diff --git a/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-2.f90 b/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-2.f90 new file mode 100644 index 000000000..2101028a9 --- /dev/null +++ b/gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-2.f90 @@ -0,0 +1,22 @@ +! PR fortran/49792 +! { dg-do run } +! { dg-options "-std=f2003 -fall-intrinsics" } + +subroutine reverse(n, a) + integer :: n + real(kind=8) :: a(n) +!$omp parallel workshare + a(:) = a(n:1:-1) +!$omp end parallel workshare +end subroutine reverse + +program pr49792 + integer :: b(16) + integer, allocatable :: a(:) + b = 1 +!$omp parallel workshare + a = b +!$omp end parallel workshare + if (size(a).ne.size(b)) call abort() + if (any (a.ne.b)) call abort() +end program pr49792 -- cgit v1.2.3