int device_type = 0;
bool indirect = false;
bool only_device_type_or_indirect = true;
+ if (flag_openmp)
+ omp_requires_mask
+ = (enum omp_requires) (omp_requires_mask | OMP_REQUIRES_TARGET_USED);
if (c_parser_next_token_is (parser, CPP_NAME)
|| (c_parser_next_token_is (parser, CPP_COMMA)
&& c_parser_peek_2nd_token (parser)->type == CPP_NAME))
int device_type = 0;
bool indirect = false;
bool only_device_type_or_indirect = true;
+ if (flag_openmp)
+ omp_requires_mask
+ = (enum omp_requires) (omp_requires_mask | OMP_REQUIRES_TARGET_USED);
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
|| (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)
&& cp_lexer_nth_token_is (parser->lexer, 2, CPP_NAME)))
switch (ret)
{
- /* Set omp_target_seen; exclude ST_OMP_DECLARE_TARGET.
- FIXME: Get clarification, cf. OpenMP Spec Issue #3240. */
+ /* For the constraints on clauses with the global requirement property,
+ we set omp_target_seen. This included all clauses that take the
+ DEVICE clause, (BEGIN) DECLARE_TARGET and procedures run the device
+ (which effectively is implied by the former). */
+ case ST_OMP_DECLARE_TARGET:
+ case ST_OMP_INTEROP:
case ST_OMP_TARGET:
case ST_OMP_TARGET_DATA:
case ST_OMP_TARGET_ENTER_DATA:
integer (omp_interop_fr_kind), parameter :: omp_ifr_hsa = 7
end module m
-subroutine sub1
+subroutine sub1 ! { dg-error "Program unit at .1. has OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFLOAD but other program units do" }
!$omp interop
integer :: y ! { dg-error "Unexpected data declaration statement" }
end subroutine sub1
end subroutine foo
end module m
-subroutine bar
+subroutine bar ! { dg-error "has OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFLOAD but other program units do" }
!use m
- !$omp requires unified_shared_memory ! Possibly OK - needs OpenMP Lang Spec clarification (-> #3240)
+ !$omp requires unified_shared_memory
!$omp declare target
end subroutine bar