Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/adjust-args-1.f90

raw
1 ! Test parsing 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 integer :: b
8 interface
9 integer function f0 (a)
10 import c_ptr
11 type(c_ptr), intent(inout) :: a
12 end function
13 integer function g (a)
14 import c_ptr
15 type(c_ptr), intent(inout) :: a
16 end function
17 integer function f1 (i)
18 integer, intent(in) :: i
19 end function
20
21 integer function f3 (a)
22 import c_ptr
23 type(c_ptr), intent(inout) :: a
24 !$omp declare variant (f1) match (construct={dispatch}) adjust_args (other: a) ! { dg-error "expected 'nothing', 'need_device_ptr' or 'need_device_addr' at .1." }
25 end function
26 integer function f4 (a)
27 import c_ptr
28 type(c_ptr), intent(inout) :: a
29 !$omp declare variant (f0) adjust_args (nothing: a) ! { dg-error "the 'adjust_args' clause at .1. can only be specified if the 'dispatch' selector of the construct selector set appears in the 'match' clause" }
30 end function
31 integer function f5 (i)
32 integer, intent(inout) :: i
33 !$omp declare variant (f1) match (construct={dispatch}) adjust_args () ! { dg-error "expected 'nothing', 'need_device_ptr' or 'need_device_addr' at .1." }
34 end function
35 integer function f6 (i)
36 integer, intent(inout) :: i
37 !$omp declare variant (f1) match (construct={dispatch}) adjust_args (nothing) ! { dg-error "expected ':' at .1." }
38 end function
39 integer function f7 (i)
40 integer, intent(inout) :: i
41 !$omp declare variant (f1) match (construct={dispatch}) adjust_args (nothing:) ! { dg-error "expected dummy parameter name, 'omp_num_args' or constant positive integer at .1." }
42 end function
43
44 end interface
45 end module