summaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-05 10:22:44 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-05 10:22:44 +0000
commitb68bb142721b73fc6d95ef3fcd8c22f68bf6da32 (patch)
tree44b8f20e7cf4a8b0f316678ebc9eb4785784df88 /libgomp/testsuite
parentc3c2ede8ef0f4013a4c489892a9d214e98c2e741 (diff)
downloadgcc-b68bb142721b73fc6d95ef3fcd8c22f68bf6da32.tar.gz
2009-01-05 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r143070 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@143072 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.c++/pr38650.C49
-rw-r--r--libgomp/testsuite/libgomp.c/atomic-6.c1
-rw-r--r--libgomp/testsuite/libgomp.c/collapse-1.c2
-rw-r--r--libgomp/testsuite/libgomp.c/pr38650.c49
4 files changed, 100 insertions, 1 deletions
diff --git a/libgomp/testsuite/libgomp.c++/pr38650.C b/libgomp/testsuite/libgomp.c++/pr38650.C
new file mode 100644
index 00000000000..ebe221adcd5
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr38650.C
@@ -0,0 +1,49 @@
+// PR c++/38650
+// { dg-do run }
+
+#include <cstdlib>
+
+int e;
+
+int
+main ()
+{
+ volatile int i, j = 10;
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; i += 1)
+ e++;
+ if (e != 10)
+ std::abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; ++i)
+ e++;
+ if (e != 10)
+ std::abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; i++)
+ e++;
+ if (e != 10)
+ std::abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; i += 1)
+ e++;
+ if (e != 10)
+ std::abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; ++i)
+ e++;
+ if (e != 10)
+ std::abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; i++)
+ e++;
+ if (e != 10)
+ std::abort ();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/atomic-6.c b/libgomp/testsuite/libgomp.c/atomic-6.c
index 949fc3d73da..8e7fca59600 100644
--- a/libgomp/testsuite/libgomp.c/atomic-6.c
+++ b/libgomp/testsuite/libgomp.c/atomic-6.c
@@ -1,5 +1,6 @@
/* PR middle-end/36106 */
/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mieee" { target alpha*-*-* } } */
/* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#ifdef __i386__
diff --git a/libgomp/testsuite/libgomp.c/collapse-1.c b/libgomp/testsuite/libgomp.c/collapse-1.c
index 82becfa7952..84277ff554d 100644
--- a/libgomp/testsuite/libgomp.c/collapse-1.c
+++ b/libgomp/testsuite/libgomp.c/collapse-1.c
@@ -17,7 +17,7 @@ main (void)
a[i][j][k] = i + j * 4 + k * 16;
#pragma omp parallel
{
- #pragma omp for collapse(2) reduction(|:l)
+ #pragma omp for collapse(2) reduction(|:l) private(k)
for (i = 0; i < 2; i++)
for (j = 0; j < 2; j++)
for (k = 0; k < 2; k++)
diff --git a/libgomp/testsuite/libgomp.c/pr38650.c b/libgomp/testsuite/libgomp.c/pr38650.c
new file mode 100644
index 00000000000..7066239b070
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr38650.c
@@ -0,0 +1,49 @@
+/* PR c++/38650 */
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+int e;
+
+int
+main ()
+{
+ volatile int i, j = 10;
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; i += 1)
+ e++;
+ if (e != 10)
+ abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; ++i)
+ e++;
+ if (e != 10)
+ abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < j; i++)
+ e++;
+ if (e != 10)
+ abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; i += 1)
+ e++;
+ if (e != 10)
+ abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; ++i)
+ e++;
+ if (e != 10)
+ abort ();
+ e = 0;
+#pragma omp parallel for reduction(+:e)
+ for (i = 0; i < 10; i++)
+ e++;
+ if (e != 10)
+ abort ();
+ return 0;
+}