Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/requires-4.f90

raw
1 subroutine bar
2 !$omp requires unified_shared_memory,unified_address,reverse_offload
3 end
4
5 module m
6 !$omp requires unified_shared_memory,unified_address,reverse_offload
7 end module m
8
9 subroutine foo
10 !$omp target
11 !$omp end target
12 ! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFLOAD 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 }
15 end
16
17 subroutine foobar
18 i = 5 ! < execution statement
19 !$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "Unexpected ..OMP REQUIRES statement" }
20 end
21
22 program main
23 !$omp requires dynamic_allocators ! OK
24 !$omp requires unified_shared_memory
25 !$omp requires unified_address
26 !$omp requires reverse_offload
27 contains
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
35 end