aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-01-24 20:56:45 +0000
committerJakub Jelinek <jakub@redhat.com>2007-01-24 20:56:45 +0000
commit2e6059316b66ab7410eb0439d3bd556b05eedac5 (patch)
tree75c43a7ce945db56bb7724178a49aded220ffc57 /libgomp
parente59b2339fcf2b954536cd0ffcd1d605ab7a1a7ce (diff)
PR middle-end/30494
* gimplify.c (omp_add_variable): Don't call omp_notice_variable on TYPE_SIZE_UNIT for GOVD_LOCAL VLAs. * gcc.dg/gomp/pr30494.c: New test. * g++.dg/gomp/pr30494.C: New test. * testsuite/libgomp.c/pr30494.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@121132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c/pr30494.c64
2 files changed, 69 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 93021993e39..e0e21298dfa 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/30494
+ * testsuite/libgomp.c/pr30494.c: New test.
+
2007-01-15 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
diff --git a/libgomp/testsuite/libgomp.c/pr30494.c b/libgomp/testsuite/libgomp.c/pr30494.c
new file mode 100644
index 00000000000..ec6828e4406
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr30494.c
@@ -0,0 +1,64 @@
+/* PR middle-end/30494 */
+/* { dg-do run } */
+
+#include <omp.h>
+
+int errors;
+
+int
+check (int m, int i, int *v, int *w)
+{
+ int j;
+ int n = omp_get_thread_num ();
+ for (j = 0; j < m; j++)
+ if (v[j] != j + n)
+ #pragma omp atomic
+ errors += 1;
+ for (j = 0; j < m * 3 + i; j++)
+ if (w[j] != j + 10 + n)
+ #pragma omp atomic
+ errors += 1;
+}
+
+int
+foo (int n, int m)
+{
+ int i;
+#pragma omp for
+ for (i = 0; i < 6; i++)
+ {
+ int v[n], w[n * 3 + i], j;
+ for (j = 0; j < n; j++)
+ v[j] = j + omp_get_thread_num ();
+ for (j = 0; j < n * 3 + i; j++)
+ w[j] = j + 10 + omp_get_thread_num ();
+ check (m, i, v, w);
+ }
+ return 0;
+}
+
+int
+bar (int n, int m)
+{
+ int i;
+#pragma omp parallel for num_threads (4)
+ for (i = 0; i < 6; i++)
+ {
+ int v[n], w[n * 3 + i], j;
+ for (j = 0; j < n; j++)
+ v[j] = j + omp_get_thread_num ();
+ for (j = 0; j < n * 3 + i; j++)
+ w[j] = j + 10 + omp_get_thread_num ();
+ check (m, i, v, w);
+ }
+ return 0;
+}
+
+int
+main (void)
+{
+#pragma omp parallel num_threads (3)
+ foo (128, 128);
+ bar (256, 256);
+ return 0;
+}