Fortran/OpenMP: Fix var-list expr parsing with array/dt
gcc/fortran/ChangeLog: * openmp.c (gfc_match_omp_variable_list): Gobble whitespace before checking whether a '%' or parenthesis-open follows as next character. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/map-5.f90: New test.
This commit is contained in:
parent
c99f374713
commit
e4aefface2
|
@ -261,6 +261,7 @@ gfc_match_omp_variable_list (const char *str, gfc_omp_namelist **list,
|
|||
case MATCH_YES:
|
||||
gfc_expr *expr;
|
||||
expr = NULL;
|
||||
gfc_gobble_whitespace ();
|
||||
if ((allow_sections && gfc_peek_ascii_char () == '(')
|
||||
|| (allow_derived && gfc_peek_ascii_char () == '%'))
|
||||
{
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
implicit none
|
||||
type t
|
||||
integer :: b(5)
|
||||
end type t
|
||||
integer :: a(5), x, y(5)
|
||||
type(t) :: b
|
||||
!$omp target enter data map( to: a (:) )
|
||||
!$omp target enter data map( to: b % b )
|
||||
!$omp target enter data map( to: a(:) )
|
||||
!$omp target depend(out: y (2)) nowait
|
||||
!$omp end target
|
||||
|
||||
end
|
Loading…
Reference in New Issue