Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/adjust-args-2a.f90

raw
1 ! Test resolution of OMP clause adjust_args
2 ! { dg-do compile }
3
4 module main
5 use iso_c_binding, only: c_ptr, c_funptr
6 implicit none
7 interface
8 subroutine f1 (i)
9 integer, intent(inout) :: i
10 end subroutine
11 subroutine h (a)
12 import c_funptr
13 type(c_funptr), intent(inout) :: a
14 end subroutine
15 end interface
16 contains
17
18 subroutine f9 (i) ! { dg-error "Argument 'i' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" }
19 integer, intent(inout) :: i
20 !$omp declare variant (f1) match (construct={dispatch}) adjust_args (need_device_ptr: i) ! { dg-error "Argument 'i' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" }
21 end subroutine
22 subroutine f13 (a) ! { dg-error "Argument 'a' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" }
23 type(c_funptr), intent(inout) :: a
24 !$omp declare variant (h) match (construct={dispatch}) adjust_args (need_device_ptr: a) ! { dg-error "Argument 'a' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" }
25 end subroutine
26
27 subroutine test
28 integer :: i
29 type(c_funptr) :: a
30 !$omp dispatch
31 call f9(i)
32 !$omp dispatch
33 call f13(a)
34 end subroutine
35
36 end module