diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-29 17:45:42 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-29 17:45:42 +0000 |
commit | 784ad964da5db2b7202645559ad9b309464effb9 (patch) | |
tree | cc238d8f70d98c37fa0b8f86e59aeaeb9dd01f24 /libgomp/testsuite/libgomp.c/pr49897-1.c | |
parent | e0b7913f41f51a594cc2df8d5ca2382b65884eba (diff) | |
download | gcc-784ad964da5db2b7202645559ad9b309464effb9.tar.gz |
PR middle-end/49897
PR middle-end/49898
* omp-low.c (use_pointer_for_field): If disallowing copy-in/out
in nested parallel and outer is a gimple_reg, mark it as addressable
and set its bit in task_shared_vars bitmap too.
* testsuite/libgomp.c/pr49897-1.c: New test.
* testsuite/libgomp.c/pr49897-2.c: New test.
* testsuite/libgomp.c/pr49898-1.c: New test.
* testsuite/libgomp.c/pr49898-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176945 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c/pr49897-1.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr49897-1.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/pr49897-1.c b/libgomp/testsuite/libgomp.c/pr49897-1.c new file mode 100644 index 00000000000..d21a26252b9 --- /dev/null +++ b/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; +} |