diff options
author | Ilya Verbin <ilya.verbin@intel.com> | 2014-12-10 20:52:10 +0000 |
---|---|---|
committer | Ilya Verbin <iverbin@gcc.gnu.org> | 2014-12-10 20:52:10 +0000 |
commit | 2354caecd9cbf380d7451769aa5cf25080fa3a3e (patch) | |
tree | 8841eb668cfea73c85c62faccb4a57c31e68a65a /libgomp | |
parent | c44f74e4cb760a204865655d2abc80276d7b6c4e (diff) | |
download | gcc-2354caecd9cbf380d7451769aa5cf25080fa3a3e.zip gcc-2354caecd9cbf380d7451769aa5cf25080fa3a3e.tar.gz gcc-2354caecd9cbf380d7451769aa5cf25080fa3a3e.tar.bz2 |
Force output of vars with "omp declare target" attribute in gcc/varpool.c
gcc/
* varpool.c (varpool_node::get_create): Force output of vars with
"omp declare target" attribute.
libgomp/
* testsuite/libgomp.c/target-9.c: New test.
From-SVN: r218607
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/target-9.c | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index acf45fb..8d8b8d8 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2014-12-10 Ilya Verbin <ilya.verbin@intel.com> + + * testsuite/libgomp.c/target-9.c: New test. + 2014-12-09 Varvara Rainchik <varvara.rainchik@intel.com> * config.h.in: Regenerate. diff --git a/libgomp/testsuite/libgomp.c/target-9.c b/libgomp/testsuite/libgomp.c/target-9.c new file mode 100644 index 0000000..00fe0cb --- /dev/null +++ b/libgomp/testsuite/libgomp.c/target-9.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O1" } */ +/* { dg-additional-options "-flto" { target lto } } */ + +#include <stdlib.h> + +#define N 123456 + +#pragma omp declare target +int X, Y; +#pragma omp end declare target + +void +foo () +{ + #pragma omp target map(alloc: X) + X = N; +} + +int +main () +{ + int res; + + foo (); + + #pragma omp target map(alloc: X, Y) map(from: res) + { + Y = N; + res = X + Y; + } + + if (res != N + N) + abort (); + + return 0; +} |