summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/gomp/requires-4.f90
blob: cc4bc3e70400cb6450474e1b44e1b4cc100250ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
subroutine bar
!$omp requires unified_shared_memory,unified_address,reverse_offload
end

module m
!$omp requires unified_shared_memory,unified_address,reverse_offload
end module m

subroutine foo
  !$omp target
  !$omp end target
! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES REVERSE_OFFLOAD but other program units do" "" { target *-*-* } 9 }
! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_ADDRESS but other program units do" "" { target *-*-* } 9 }
! { dg-error "OpenMP device constructs/routines but does not set !.OMP REQUIRES UNIFIED_SHARED_MEMORY but other program units do" "" { target *-*-* } 9 }
end

subroutine foobar
i = 5  ! < execution statement
!$omp requires atomic_default_mem_order(seq_cst) ! { dg-error "Unexpected ..OMP REQUIRES statement" }
end

program main
!$omp requires dynamic_allocators ! OK
!$omp requires unified_shared_memory
!$omp requires unified_address
!$omp requires reverse_offload
contains
  subroutine foo
    !$target
    !$end target
  end subroutine
  subroutine bar
    !$omp requires unified_addres ! { dg-error "must appear in the specification part of a program unit" }
  end subroutine bar
end
! { dg-prune-output "not yet supported" }