aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/libgomp/testsuite
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2012-02-15 15:40:16 -0800
committerJing Yu <jingyu@google.com>2012-02-15 15:40:16 -0800
commit3f73d6ef90458b45bbbb33ef4c2b174d4662a22d (patch)
tree1b5f0d96c51b51168b3713058a1b62e92f1136eb /gcc-4.6/libgomp/testsuite
parentd7030123e04baab5dbff9c9ee04c0de99bd9a774 (diff)
downloadtoolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.gz
toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.tar.bz2
toolchain_gcc-3f73d6ef90458b45bbbb33ef4c2b174d4662a22d.zip
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
Diffstat (limited to 'gcc-4.6/libgomp/testsuite')
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-1.c31
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.c/pr49897-2.c25
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-1.c26
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.c/pr49898-2.c18
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-1.f9018
-rw-r--r--gcc-4.6/libgomp/testsuite/libgomp.fortran/pr49792-2.f9022
6 files changed, 140 insertions, 0 deletions
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