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/testsuite/libgomp.c | |
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/testsuite/libgomp.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr90779.c | 18 |
1 files changed, 18 insertions, 0 deletions
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; +} |