diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-02 15:23:55 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-02 15:23:55 +0000 |
commit | a217eb614007708e37e64dde0e08c53672cb4ce8 (patch) | |
tree | a62894572a4c16deff12aa8a4292fec0e424af08 /libgomp | |
parent | 61087bee65377ecf20720addf51ff00fbefded1b (diff) | |
download | gcc-a217eb614007708e37e64dde0e08c53672cb4ce8.tar.gz |
2009-04-02 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r145451
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@145454 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 7 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr39591-1.c | 33 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr39591-2.c | 39 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr39591-3.c | 40 |
4 files changed, 119 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index a77fdde70e9..15eb2c6c769 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,10 @@ +2009-04-01 Jakub Jelinek <jakub@redhat.com> + + PR other/39591 + * testsuite/libgomp.c/pr39591-1.c: New test. + * testsuite/libgomp.c/pr39591-2.c: New test. + * testsuite/libgomp.c/pr39591-3.c: New test. + 2009-03-25 Uros Bizjak <ubizjak@gmail.com> * testsuite/libgomp.c/atomic-5.c: Cleanup cpuid usage. diff --git a/libgomp/testsuite/libgomp.c/pr39591-1.c b/libgomp/testsuite/libgomp.c/pr39591-1.c new file mode 100644 index 00000000000..dfd8d9e8aca --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr39591-1.c @@ -0,0 +1,33 @@ +/* PR other/39591 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +int err; + +int +main (void) +{ +#pragma omp parallel + { + int array[40]; + int i; + for (i = 0; i < sizeof array / sizeof array[0]; i++) + array[i] = 0x55555555; + +#pragma omp for schedule(dynamic) + for (i = 0; i < 50; i++) +#pragma omp task shared(array) + { + int j; + for (j = 0; j < sizeof array / sizeof array[0]; j++) + if (array[j] != 0x55555555) +#pragma omp atomic + err++; + } + } + if (err) + abort (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/pr39591-2.c b/libgomp/testsuite/libgomp.c/pr39591-2.c new file mode 100644 index 00000000000..b5f8f9cc7b2 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr39591-2.c @@ -0,0 +1,39 @@ +/* PR other/39591 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +int err; + +void __attribute__((noinline)) +foo (int *array) +{ +#pragma omp task + { + int j; + for (j = 0; j < sizeof array / sizeof array[0]; j++) + if (array[j] != 0x55555555) +#pragma omp atomic + err++; + } +} + +int +main (void) +{ +#pragma omp parallel + { + int array[40]; + int i; + for (i = 0; i < sizeof array / sizeof array[0]; i++) + array[i] = 0x55555555; + +#pragma omp for schedule (dynamic) + for (i = 0; i < 50; i++) + foo (array); + } + if (err) + abort (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/pr39591-3.c b/libgomp/testsuite/libgomp.c/pr39591-3.c new file mode 100644 index 00000000000..a9aeea7c83a --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr39591-3.c @@ -0,0 +1,40 @@ +/* PR other/39591 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +int err, a[40]; + +void __attribute__((noinline)) +foo (int *array) +{ +#pragma omp task + { + int j; + for (j = 0; j < sizeof array / sizeof array[0]; j++) + if (array[j] != 0x55555555) +#pragma omp atomic + err++; + } +} + +int +main (void) +{ + int k; + for (k = 0; k < sizeof a / sizeof a[0]; k++) + a[k] = 0x55555555; + +#pragma omp parallel + { + int i; + +#pragma omp for schedule (dynamic) + for (i = 0; i < 50; i++) + foo (a); + } + if (err) + abort (); + return 0; +} |