[memprof] Move YAML support to MemProfYAML.h (NFC) (#119515)
[llvm-project.git] / flang / test / Semantics / OpenMP / requires04.f90
blob1fbb3aa6219bc3c908c9c2820218c2ad248b1c05
1 ! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=52
2 ! OpenMP Version 5.0
3 ! 2.4 Requires directive
4 ! Target-related clauses in 'requires' directives must come strictly before any
5 ! device constructs, such as declare target with device_type=nohost|any.
7 subroutine f
8 integer, save :: x
9 !WARNING: The usage of TO clause on DECLARE TARGET directive has been deprecated. Use ENTER clause instead.
10 !$omp declare target to(x) device_type(nohost)
11 !$omp declare target enter(x) device_type(nohost)
12 end subroutine f
14 subroutine g
15 !ERROR: REQUIRES directive with 'DYNAMIC_ALLOCATORS' clause found lexically after device construct
16 !$omp requires dynamic_allocators
17 !ERROR: REQUIRES directive with 'REVERSE_OFFLOAD' clause found lexically after device construct
18 !$omp requires reverse_offload
19 !ERROR: REQUIRES directive with 'UNIFIED_ADDRESS' clause found lexically after device construct
20 !$omp requires unified_address
21 !ERROR: REQUIRES directive with 'UNIFIED_SHARED_MEMORY' clause found lexically after device construct
22 !$omp requires unified_shared_memory
23 end subroutine g