diff options
author | Martin Jambor <mjambor@suse.cz> | 2018-02-08 14:03:52 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2018-02-08 14:03:52 +0100 |
commit | c7c30edd4a6049a0debe0ed17ffdb9c196d4c677 (patch) | |
tree | 1ddc2a0a9a52e7b9fbe52d94618bbcaeb647280b /libgomp | |
parent | 414fef4e668856edb8ca885525679c5d5e691fd1 (diff) | |
download | gcc-c7c30edd4a6049a0debe0ed17ffdb9c196d4c677.tar.gz |
[hsa] Set program allocation for static local variables
2018-02-08 Martin Jambor <mjambor@suse.cz>
* hsa-gen.c (get_symbol_for_decl): Set program allocation for
static local variables.
libgomp/
* testsuite/libgomp.hsa.c/staticvar.c: New test.
From-SVN: r257484
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.hsa.c/staticvar.c | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index df8a57d6ab1..d0130490de3 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2018-02-08 Martin Jambor <mjambor@suse.cz> + + * testsuite/libgomp.hsa.c/staticvar.c: New test. + 2018-02-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * testsuite/libgomp.oacc-c-c++-common/pr84217.c (abort) diff --git a/libgomp/testsuite/libgomp.hsa.c/staticvar.c b/libgomp/testsuite/libgomp.hsa.c/staticvar.c new file mode 100644 index 00000000000..6d20c9aa328 --- /dev/null +++ b/libgomp/testsuite/libgomp.hsa.c/staticvar.c @@ -0,0 +1,23 @@ +extern void abort (void); + +#pragma omp declare target +int +foo (void) +{ + static int s; + return ++s; +} +#pragma omp end declare target + +int +main () +{ + int r; + #pragma omp target map(from:r) + { + r = foo (); + } + if (r != 1) + abort (); + return 0; +} |