diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-06-15 09:09:04 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-06-15 09:09:04 +0200 |
commit | 211b7533bff68e5dd72e7d75249f470101759d6d (patch) | |
tree | 2ee472c92423b3830a2afa44855e5bf7fdf62803 /libgomp | |
parent | 120a01d160cd47b4276507dc8f6c1ab571a9c006 (diff) | |
download | gcc-211b7533bff68e5dd72e7d75249f470101759d6d.zip gcc-211b7533bff68e5dd72e7d75249f470101759d6d.tar.gz gcc-211b7533bff68e5dd72e7d75249f470101759d6d.tar.bz2 |
re PR middle-end/90779 (Fortran array initialization in offload regions)
PR middle-end/90779
* gimplify.c: Include omp-offload.h and context.h.
(gimplify_bind_expr): Add "omp declare target" attributes
to static block scope variables inside of target region or target
functions.
* c-c++-common/goacc/routine-5.c (func2): Don't expect error for
static block scope variable in #pragma acc routine.
* testsuite/libgomp.c/pr90779.c: New test.
* testsuite/libgomp.fortran/pr90779.f90: New test.
From-SVN: r272322
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 6 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr90779.c | 18 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr90779.f90 | 12 |
3 files changed, 36 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 9a1fcff1f..bc8647b 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,9 @@ +2019-06-15 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/90779 + * testsuite/libgomp.c/pr90779.c: New test. + * testsuite/libgomp.fortran/pr90779.f90: New test. + 2019-06-15 Tom de Vries <tdevries@suse.de> PR tree-optimization/90009 diff --git a/libgomp/testsuite/libgomp.c/pr90779.c b/libgomp/testsuite/libgomp.c/pr90779.c new file mode 100644 index 0000000..0dd1c10 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr90779.c @@ -0,0 +1,18 @@ +/* PR middle-end/90779 */ + +extern void abort (void); + +int +main () +{ + int i, j; + for (i = 0; i < 2; ++i) + #pragma omp target map(from: j) + { + static int k = 5; + j = ++k; + } + if (j != 7) + abort (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.fortran/pr90779.f90 b/libgomp/testsuite/libgomp.fortran/pr90779.f90 new file mode 100644 index 0000000..a6d687a --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr90779.f90 @@ -0,0 +1,12 @@ +! PR middle-end/90779 + +program pr90779 + implicit none + integer :: v(4), i + + !$omp target map(from:v) + v(:) = (/ (i, i=1,4) /) + !$omp end target + + if (any (v .ne. (/ (i, i=1,4) /))) stop 1 +end program |