Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/append_args-2.f90

raw
1 ! { dg-do compile }
2 ! { dg-additional-options "-fcoarray=single" }
3
4 module my_omp_lib
5 use iso_c_binding
6 implicit none
7
8 ! The following definitions are in omp_lib, which cannot be included
9 ! in gcc/testsuite/
10 integer, parameter :: omp_interop_kind = c_intptr_t
11 integer, parameter :: omp_interop_fr_kind = c_int
12
13 integer (omp_interop_kind), parameter :: omp_interop_none = 0_omp_interop_kind
14 integer (omp_interop_fr_kind), parameter :: omp_ifr_cuda = 1
15 integer (omp_interop_fr_kind), parameter :: omp_ifr_cuda_driver = 2
16 integer (omp_interop_fr_kind), parameter :: omp_ifr_opencl = 3
17 integer (omp_interop_fr_kind), parameter :: omp_ifr_sycl = 4
18 integer (omp_interop_fr_kind), parameter :: omp_ifr_hip = 5
19 integer (omp_interop_fr_kind), parameter :: omp_ifr_level_zero = 6
20 integer (omp_interop_fr_kind), parameter :: omp_ifr_hsa = 7
21 end module my_omp_lib
22
23 module m
24 use my_omp_lib
25 implicit none
26 logical, parameter :: flag = .true.
27 contains
28 subroutine f1o (obj)
29 integer(omp_interop_kind),value :: obj
30 end
31
32 subroutine f1ox (q,r, obj)
33 ! { dg-error "'q' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
34 type(c_ptr) :: q, r
35 value :: r
36 integer(omp_interop_kind),value :: obj
37 end
38
39
40 subroutine f5 ()
41 !$omp declare variant (f1ox) match(user={condition(flag)}) & ! { dg-error "the 'append_args' clause can only be specified if the 'dispatch' selector of the construct selector set appears in the 'match' clause at .1." }
42 !$omp& append_args ( interop ( target , targetsync) )
43 ! { dg-error "'q' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
44 end subroutine
45
46 subroutine f6 (x, y)
47 !$omp declare variant (f1ox) match(user={condition(flag)}) & ! { dg-error "the 'adjust_args' clause can only be specified if the 'dispatch' selector of the construct selector set appears in the 'match' clause at .1." }
48 !$omp& append_args ( interop ( target , targetsync) ) &
49 !$omp& adjust_args ( need_device_ptr : x , y)
50 type(c_ptr) :: x, y
51 value :: y
52 end subroutine
53
54 subroutine g1 (obj, obj2, obj3)
55 integer(omp_interop_kind),value :: obj,obj3
56 integer(omp_interop_kind),value :: obj2
57 end
58 subroutine g1a (obj)
59 !$omp declare variant (g1 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
60 integer(omp_interop_kind),value :: obj
61 end
62
63 subroutine g2 (obj, obj2, obj3)
64 ! { dg-error "'g2' at .1. has 2 but requires 1 'omp_interop_kind' kind dummy arguments as it is utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
65 integer(omp_interop_kind),value :: obj,obj2,obj3
66 end
67 subroutine g2a (obj)
68 !$omp declare variant (g2 ) match(construct={dispatch}) append_args ( interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")}), targetsync))
69 ! { dg-error "'g2' at .1. has 2 but requires 1 'omp_interop_kind' kind dummy arguments as it is utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
70 integer(omp_interop_kind),value :: obj
71 end
72
73 subroutine g3 (obj, obj2, obj3)
74 integer(omp_interop_kind),value :: obj,obj3
75 integer(omp_interop_kind) :: obj2
76 end
77 subroutine g3a (obj)
78 !$omp declare variant (g3 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
79 integer(omp_interop_kind),value :: obj
80 end
81
82 subroutine g4 (obj, obj2, obj3)
83 integer(omp_interop_kind),value :: obj,obj3
84 integer(omp_interop_kind) :: obj2
85 end
86 subroutine g4a (obj)
87 !$omp declare variant (g4 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
88 integer(omp_interop_kind),value :: obj
89 end
90
91 subroutine g5 (obj, obj2, obj3)
92 ! { dg-error "'obj3' at .1. with OPTIONAL attribute not support when utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
93 integer(omp_interop_kind),value :: obj,obj3
94 integer(omp_interop_kind) :: obj2
95 optional :: obj3
96 end
97 subroutine g5a (obj)
98 !$omp declare variant (g5 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
99 ! { dg-error "'obj3' at .1. with OPTIONAL attribute not support when utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
100 integer(omp_interop_kind),value :: obj
101 end
102
103 subroutine g5var (obj, obj2, obj3)
104 ! { dg-error "'obj3' at .1. with OPTIONAL attribute not support when utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
105 integer(omp_interop_kind) :: obj,obj3
106 integer(omp_interop_kind) :: obj2
107 value :: obj
108 optional :: obj3
109 end
110 subroutine g5avar (obj)
111 !$omp declare variant (g5var ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
112 ! { dg-error "'obj3' at .1. with OPTIONAL attribute not support when utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
113 integer(omp_interop_kind),value :: obj
114 end
115
116 subroutine g6 (obj, obj2, obj3)
117 ! { dg-error "'obj3' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
118 integer(omp_interop_kind),value :: obj
119 integer(omp_interop_kind),pointer :: obj3
120 integer(omp_interop_kind) :: obj2
121 end
122 subroutine g6a (obj)
123 !$omp declare variant (g6 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
124 ! { dg-error "'obj3' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
125 integer(omp_interop_kind),value :: obj
126 end
127
128 subroutine g7 (obj, obj2, obj3)
129 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
130 integer(omp_interop_kind),value :: obj
131 integer(omp_interop_kind) :: obj3
132 integer(omp_interop_kind),allocatable :: obj2
133 end
134 subroutine g7a (obj)
135 !$omp declare variant (g7 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
136 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
137 integer(omp_interop_kind),value :: obj
138 end
139
140 subroutine g8 (obj, obj2, obj3)
141 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
142 integer(omp_interop_kind),value :: obj
143 integer(omp_interop_kind) :: obj3
144 integer(omp_interop_kind) :: obj2(:)
145 end
146 subroutine g8a (obj)
147 !$omp declare variant (g8 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
148 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
149 integer(omp_interop_kind),value :: obj
150 end
151
152 subroutine g9 (obj, obj2, obj3)
153 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
154 integer(omp_interop_kind),value :: obj
155 integer(omp_interop_kind) :: obj3
156 integer(omp_interop_kind) :: obj2(2)
157 end
158 subroutine g9a (obj)
159 !$omp declare variant (g9 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
160 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
161 integer(omp_interop_kind),value :: obj
162 end
163
164 subroutine g10 (obj, obj2, obj3)
165 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
166 integer(omp_interop_kind),value :: obj
167 integer(omp_interop_kind) :: obj3
168 integer(1) :: obj2
169 end
170 subroutine g10a (obj)
171 !$omp declare variant (g10 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
172 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
173 integer(omp_interop_kind),value :: obj
174 end
175
176 subroutine g11 (obj, obj2, obj3)
177 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
178 integer(omp_interop_kind),value :: obj
179 integer(omp_interop_kind) :: obj3
180 real(omp_interop_kind) :: obj2 ! { dg-warning "C kind type parameter is for type INTEGER but type at .1. is REAL" }
181 end
182 subroutine g11a (obj)
183 !$omp declare variant (g11 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
184 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
185 integer(omp_interop_kind),value :: obj
186 end
187
188 subroutine g12 (obj, obj2, obj3)
189 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
190 integer(omp_interop_kind),value :: obj
191 integer(omp_interop_kind) :: obj3
192 integer(omp_interop_kind) :: obj2[*]
193 end
194 subroutine g12a (obj)
195 !$omp declare variant (g12 ) match(construct={dispatch}) append_args ( interop ( target , targetsync), interop( target, prefer_type ( {fr("cuda"), attr("ompx_xx")}, {attr("ompx_yy")} )))
196 ! { dg-error "'obj2' at .1. must be a nonpointer, nonallocatable scalar integer dummy argument of 'omp_interop_kind' kind as it utilized with the 'append_args' clause at .2." "" { target *-*-* } .-1 }
197 integer(omp_interop_kind),value :: obj
198 end
199 end