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
+2014-12-10 Ilya Verbin <ilya.verbin@intel.com>
+
+ * varpool.c (varpool_node::get_create): Force output of vars with
+ "omp declare target" attribute.
+
2014-12-10 Marc Glisse <marc.glisse@inria.fr>
* real.h (HONOR_NANS): Replace macro with 3 overloaded declarations.
g->have_offload = true;
if (!in_lto_p)
vec_safe_push (offload_vars, decl);
+ node->force_output = 1;
#endif
}
+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.
--- /dev/null
+/* { 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;
+}