Debian Codegraph @

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

raw
1 module m
2 implicit none
3 contains
4 subroutine f(x,y,z)
5 integer:: x, y, z
6 value :: y
7 end subroutine
8 subroutine f0(x,y,z)
9 !$omp declare variant(f) adjust_args ( need_device_addr : : omp_num_args-1) &
10 !$omp& adjust_args ( need_device_ptr : z) &
11 !$omp& match ( construct = { dispatch } )
12 integer:: x, y, z
13 value :: y
14
15 ! { dg-error "19: Argument 'y' at .1. to list item in 'need_device_addr' at .2. must not have the VALUE attribute" "" { target *-*-* } 8 }
16 ! { dg-error "62: Argument 'y' at .1. to list item in 'need_device_addr' at .2. must not have the VALUE attribute" "" { target *-*-* } 9 }
17 ! { dg-message "sorry, unimplemented: 'need_device_addr' not yet supported" "" { target *-*-* } 9 }
18
19 ! { dg-error "Argument 'z' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" "" { target *-*-* } 8 }
20 ! { dg-error "Argument 'z' at .1. to list item in 'need_device_ptr' at .2. must be a scalar of TYPE\\(C_PTR\\)" "" { target *-*-* } 10 }
21 ! { dg-note "Consider using 'need_device_addr' instead" "" { target *-*-* } 10 }
22 end subroutine
23 end module m
24
25 module m2
26 use iso_c_binding, only: c_ptr
27 implicit none
28 interface
29 subroutine f(x,y,z)
30 import
31 type(c_ptr) :: x, y, z
32 end subroutine
33 subroutine f0(x,y,z)
34 import
35 type(c_ptr) :: x, y, z
36 !$omp declare variant(f) adjust_args ( need_device_ptr : : ) &
37 !$omp& adjust_args ( nothing : 2, 4) &
38 !$omp& match ( construct = { dispatch } )
39
40 ! { dg-error "54: 'y' at .1. is specified more than once" "" { target *-*-* } 37 }
41 ! { dg-warning "57: Argument index at .1. exceeds number of arguments 3 \\\[-Wopenmp\\\]" "" { target *-*-* } 37 }
42 end subroutine
43 end interface
44 end module m2
45
46 module m3
47 use iso_c_binding, only: c_ptr
48 implicit none
49 interface
50 subroutine f(x,y,z)
51 import
52 type(c_ptr) :: x, y, z
53 end subroutine
54 subroutine f0(x,y,z)
55 import
56 type(c_ptr) :: x, y, z
57 !$omp declare variant(f) adjust_args ( need_device_addr : omp_num_args -4 :, 3 : 2) &
58 !$omp& match ( construct = { dispatch } )
59 ! { dg-warning "63: Expected positive argument index at .1. \\\[-Wopenmp\\\]" "" { target *-*-* } .-2 }
60 ! { dg-warning "82: Upper argument index smaller than lower one at .1. \\\[-Wopenmp\\\]" "" { target *-*-* } .-3 }
61 end subroutine
62 end interface
63 end module m3
64
65 module m4
66 use iso_c_binding, only: c_ptr
67 implicit none
68 interface
69 subroutine f(x,y,z)
70 import
71 type(c_ptr) :: x, y, z
72 end subroutine
73 subroutine f0(x,y,z)
74 import
75 type(c_ptr) :: x, y, z
76 !$omp declare variant(f) adjust_args ( need_device_addr : x, y, omp_num_args -2 : omp_num_args -1) &
77 !$omp& adjust_args ( need_device_addr : z) &
78 !$omp& adjust_args ( need_device_addr : omp_num_args : 3) &
79 !$omp& match ( construct = { dispatch } )
80 ! { dg-error "69: 'x' at .1. is specified more than once" "" { target *-*-* } .-4 }
81 ! { dg-error "69: 'y' at .1. is specified more than once" "" { target *-*-* } .-5 }
82 ! { dg-error "63: 'z' at .1. is specified more than once" "" { target *-*-* } .-4 }
83 end subroutine
84 end interface
85 end module m4