+2015-06-03 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ * c-decl.c (c_decl_attributes): Also add "omp declare target"
+ attribute for DECL_EXTERNAL VAR_DECLs.
+
2015-02-27 Marek Polacek <polacek@redhat.com>
Backported from mainline
{
/* Add implicit "omp declare target" attribute if requested. */
if (current_omp_declare_target_attribute
- && ((TREE_CODE (*node) == VAR_DECL && TREE_STATIC (*node))
+ && ((TREE_CODE (*node) == VAR_DECL
+ && (TREE_STATIC (*node) || DECL_EXTERNAL (*node)))
|| TREE_CODE (*node) == FUNCTION_DECL))
{
if (TREE_CODE (*node) == VAR_DECL
+2015-06-03 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ * decl2.c (cplus_decl_attributes): Also add "omp declare target"
+ attribute for DECL_EXTERNAL VAR_DECLs.
+
2015-04-29 Thomas Schwinge <thomas@codesourcery.com>
Backport from trunk r222564:
/* Add implicit "omp declare target" attribute if requested. */
if (scope_chain->omp_declare_target_attribute
- && ((TREE_CODE (*decl) == VAR_DECL && TREE_STATIC (*decl))
+ && ((TREE_CODE (*decl) == VAR_DECL
+ && (TREE_STATIC (*decl) || DECL_EXTERNAL (*decl)))
|| TREE_CODE (*decl) == FUNCTION_DECL))
{
if (TREE_CODE (*decl) == VAR_DECL
+2015-06-03 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-03-19 Jakub Jelinek <jakub@redhat.com>
+
+ * testsuite/libgomp.c/target-10.c: New test.
+ * testsuite/libgomp.c++/target-4.C: New test.
+
2015-04-02 Sebastian Huber <sebastian.huber@embedded-brains.de>
Backported from mainline
--- /dev/null
+// { dg-do run }
+
+#include "../libgomp.c/target-10.c"
--- /dev/null
+/* { dg-do run } */
+
+#pragma omp declare target
+extern int v;
+#pragma omp end declare target
+
+int v;
+
+int
+main ()
+{
+ #pragma omp target update to(v)
+ return 0;
+}