diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-27 19:45:14 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-27 19:45:14 +0000 |
commit | 919041c78aa12eb6523e5616249fa20a3daae39a (patch) | |
tree | 8a25e70be23ac06cb0b9b579a0923434c229535c /libgomp | |
parent | 1d22f5410404086ab5a422b394c9bcf00b64973a (diff) | |
download | gcc-919041c78aa12eb6523e5616249fa20a3daae39a.tar.gz |
* gimplify.c (omp_is_private): Don't return true if decl
is not already private on #pragma omp for or #pragma omp parallel for.
* gcc.dg/gomp/pr27388-3.c: Adjust dg-final.
* testsuite/libgomp.c/loop-10.c: New test.
* libgomp.c/loop-3.c (main): Add lastprivate clause.
* libgomp.c++/loop-6.C (main): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c++/loop-6.C | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/loop-10.c | 30 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/loop-3.c | 5 |
4 files changed, 40 insertions, 4 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 18e1bf7c43a..ad550e8fa33 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,9 @@ 2008-06-27 Jakub Jelinek <jakub@redhat.com> + * testsuite/libgomp.c/loop-10.c: New test. + * libgomp.c/loop-3.c (main): Add lastprivate clause. + * libgomp.c++/loop-6.C (main): Likewise. + PR debug/36617 * testsuite/libgomp.c/debug-1.c: New test. diff --git a/libgomp/testsuite/libgomp.c++/loop-6.C b/libgomp/testsuite/libgomp.c++/loop-6.C index fa26c6892cf..f4a6925a40c 100644 --- a/libgomp/testsuite/libgomp.c++/loop-6.C +++ b/libgomp/testsuite/libgomp.c++/loop-6.C @@ -8,10 +8,11 @@ static int test(void) return ++count > 0; } +int i; + int main() { - int i; - #pragma omp for + #pragma omp for lastprivate (i) for (i = 0; i < 10; ++i) { if (test()) diff --git a/libgomp/testsuite/libgomp.c/loop-10.c b/libgomp/testsuite/libgomp.c/loop-10.c new file mode 100644 index 00000000000..1b42c4bf126 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-10.c @@ -0,0 +1,30 @@ +extern void abort (void); + +int i = 8; + +int main (void) +{ + int j = 7, k = 0; + #pragma omp for + for (i = 0; i < 10; i++) + ; + #pragma omp for + for (j = 0; j < 10; j++) + ; + /* OpenMP 3.0 newly guarantees that the original list items can't + be shared with the privatized omp for iterators, even when + the original list items are already private. */ + if (i != 8 || j != 7) + abort (); + #pragma omp parallel private (i) reduction (+:k) + { + i = 6; + #pragma omp for + for (i = 0; i < 10; i++) + ; + k = (i != 6); + } + if (k) + abort (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/loop-3.c b/libgomp/testsuite/libgomp.c/loop-3.c index ba3ecdaca3a..f0f9b4705f9 100644 --- a/libgomp/testsuite/libgomp.c/loop-3.c +++ b/libgomp/testsuite/libgomp.c/loop-3.c @@ -8,10 +8,11 @@ static int test(void) return ++count > 0; } +int i; + int main() { - int i; - #pragma omp for + #pragma omp for lastprivate (i) for (i = 0; i < 10; ++i) { if (test()) |