1subroutine bar
2!$omp requires unified_shared_memory,unified_address,reverse_offload
3end
4
5module m
6!$omp requires unified_shared_memory,unified_address,reverse_offload
7end module m
8
9subroutine foo
10  !$omp target
11  !$omp end target
12! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFSET but other program units do" "" { target *-*-* } 9 }
13! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_ADDRESS but other program units do" "" { target *-*-* } 9 }
14! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_SHARED_MEMORY but other program units do" "" { target *-*-* } 9 }
15end
16
17subroutine foobar
18i = 5  ! < execution statement
19!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "Unexpected ..OMP REQUIRES statement" }
20end
21
22program main
23!$omp requires dynamic_allocators ! OK
24!$omp requires unified_shared_memory
25!$omp requires unified_address
26!$omp requires reverse_offload
27contains
28  subroutine foo
29    !$omp target
30    !$omp end target
31  end subroutine
32  subroutine bar
33    !$omp requires unified_address ! { dg-error "must appear in the specification part of a program unit" }
34  end subroutine bar
35end
36! { dg-prune-output "not yet supported" }
37