+2019-06-18 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR fortran/85221
+ * trans-decl.c (add_attributes_to_decl): Handle OpenACC 'declare'
+ directive.
+
2019-06-16 Thomas Koenig <tkoenig@gcc.gnu.org>
* dump_parse_tree (debug): Add verison for formal arglist.
list = oacc_replace_fn_attrib_attr (list, dims);
}
- if (sym_attr.omp_declare_target_link)
+ if (sym_attr.omp_declare_target_link
+ || sym_attr.oacc_declare_link)
list = tree_cons (get_identifier ("omp declare target link"),
NULL_TREE, list);
- else if (sym_attr.omp_declare_target)
+ else if (sym_attr.omp_declare_target
+ || sym_attr.oacc_declare_create
+ || sym_attr.oacc_declare_copyin
+ || sym_attr.oacc_declare_deviceptr
+ || sym_attr.oacc_declare_device_resident)
list = tree_cons (get_identifier ("omp declare target"),
clauses, list);
2019-06-18 Thomas Schwinge <thomas@codesourcery.com>
+ PR fortran/85221
+ * gfortran.dg/goacc/declare-3.f95: New file.
+
PR middle-end/90859
* c-c++-common/goacc/firstprivate-mappings-1.c: Update.
--- /dev/null
+! Test valid usage of the OpenACC 'declare' directive.
+
+module mod_a
+ implicit none
+ integer :: a
+ !$acc declare create (a)
+end module
+
+module mod_b
+ implicit none
+ integer :: b
+ !$acc declare copyin (b)
+end module
+
+module mod_c
+ implicit none
+ integer :: c
+ !$acc declare deviceptr (c)
+end module
+
+module mod_d
+ implicit none
+ integer :: d
+ !$acc declare device_resident (d)
+end module
+
+module mod_e
+ implicit none
+ integer :: e
+ !$acc declare link (e)
+end module
+
+subroutine sub1
+ use mod_a
+ use mod_b
+ use mod_c
+ use mod_d
+ use mod_e
+end subroutine sub1
+
+program test
+ use mod_a
+ use mod_b
+ use mod_c
+ use mod_d
+ use mod_e
+end program test