1module main
2contains
3  subroutine f1 ()
4  end subroutine
5  subroutine f2 ()
6    !$omp declare variant (f1) match (construct={target})
7  end subroutine
8  subroutine f3 ()
9  end subroutine
10  subroutine f4 ()
11    !$omp declare variant (f3) match (construct={teams})
12  end subroutine
13  subroutine f5 ()
14  end subroutine
15  subroutine f6 ()
16    !$omp declare variant (f5) match (construct={parallel})
17  end subroutine
18  subroutine f7 ()
19  end subroutine
20  subroutine f8 ()
21    !$omp declare variant (f7) match (construct={do})
22  end subroutine
23  subroutine f9 ()
24  end subroutine
25  subroutine f10 ()
26    !$omp declare variant (f9) match (construct={target,teams,parallel,do})
27  end subroutine
28  subroutine f11 ()
29  end subroutine
30  subroutine f12 ()
31    !$omp declare variant (f11) match (construct={teams,do,parallel})
32  end subroutine
33  subroutine f13 ()
34  end subroutine
35  subroutine f14 ()
36    !$omp declare variant (f13) match (device={kind(any)})
37  end subroutine
38  subroutine f15 ()
39    !$omp declare variant (f13) match (device={kind("host")})
40  end subroutine
41  subroutine f16 ()
42    !$omp declare variant (f13) match (device={kind(nohost)})
43  end subroutine
44  subroutine f17 ()
45    !$omp declare variant (f13) match (device={kind(cpu)})
46  end subroutine
47  subroutine f18 ()
48    !$omp declare variant (f13) match (device={kind("gpu")})
49  end subroutine
50  subroutine f19 ()
51    !$omp declare variant (f13) match (device={kind(fpga)})
52  end subroutine
53  subroutine f20 ()
54    !$omp declare variant (f13) match (device={kind(any,any)})
55  end subroutine
56  subroutine f21 ()
57    !$omp declare variant (f13) match (device={kind(host,nohost)})
58  end subroutine
59  subroutine f22 ()
60    !$omp declare variant (f13) match (device={kind("cpu","gpu","fpga")})
61  end subroutine
62  subroutine f23 ()
63    !$omp declare variant (f13) match (device={kind(any,cpu,nohost)})
64  end subroutine
65  subroutine f24 ()
66    !$omp declare variant (f13) match (device={isa(avx)})
67  end subroutine
68  subroutine f25 ()
69    !$omp declare variant (f13) match (device={isa(sse4,"avx512f",avx512vl,avx512bw)})
70  end subroutine
71  subroutine f26 ()
72    !$omp declare variant (f13) match (device={arch("x86_64")})
73  end subroutine
74  subroutine f27 ()
75    !$omp declare variant (f13) match (device={arch(riscv64)})
76  end subroutine
77  subroutine f28 ()
78    !$omp declare variant (f13) match (device={arch(nvptx)})
79  end subroutine
80  subroutine f29 ()
81    !$omp declare variant (f13) match (device={arch(x86_64),isa("avx512f","avx512vl"),kind(cpu)})
82  end subroutine
83  subroutine f30 ()
84    !$omp declare variant (f13) match (implementation={vendor(amd)})
85  end subroutine
86  subroutine f31 ()
87    !$omp declare variant (f13) match (implementation={vendor(arm)})
88  end subroutine
89  subroutine f32 ()
90    !$omp declare variant (f13) match (implementation={vendor("bsc")})
91  end subroutine
92  subroutine f33 ()
93    !$omp declare variant (f13) match (implementation={vendor(cray)})
94  end subroutine
95  subroutine f34 ()
96    !$omp declare variant (f13) match (implementation={vendor(fujitsu)})
97  end subroutine
98  subroutine f35 ()
99    !$omp declare variant (f13) match (implementation={vendor(gnu)})
100  end subroutine
101  subroutine f36 ()
102    !$omp declare variant (f13) match (implementation={vendor(ibm)})
103  end subroutine
104  subroutine f37 ()
105    !$omp declare variant (f13) match (implementation={vendor("intel")})
106  end subroutine
107  subroutine f38 ()
108    !$omp declare variant (f13) match (implementation={vendor(llvm)})
109  end subroutine
110  subroutine f39 ()
111    !$omp declare variant (f13) match (implementation={vendor(pgi)})
112  end subroutine
113  subroutine f40 ()
114    !$omp declare variant (f13) match (implementation={vendor(ti)})
115  end subroutine
116  subroutine f41 ()
117    !$omp declare variant (f13) match (implementation={vendor(unknown)})
118  end subroutine
119  subroutine f42 ()
120    !$omp declare variant (f13) match (implementation={vendor(gnu,llvm,intel,ibm)})
121  end subroutine
122  subroutine f43 ()
123    !$omp declare variant (f13) match (implementation={extension(my_cute_extension)})	! { dg-warning "unknown property 'my_cute_extension' of 'extension' selector" }
124  end subroutine
125  subroutine f44 ()
126    !$omp declare variant (f13) match (implementation={extension(some_other_ext,another_ext)})	! { dg-warning "unknown property 'some_other_ext' of 'extension' selector" }
127												! { dg-warning "unknown property 'another_ext' of 'extension' selector" "" { target *-*-* } .-1 }
128  end subroutine
129  subroutine f45 ()
130    !$omp declare variant (f13) match (implementation={unified_shared_memory})
131  end subroutine
132  subroutine f46 ()
133    !$omp declare variant (f13) match (implementation={unified_address})
134  end subroutine
135  subroutine f47 ()
136    !$omp declare variant (f13) match (implementation={dynamic_allocators})
137  end subroutine
138  subroutine f48 ()
139    !$omp declare variant (f13) match (implementation={reverse_offload})
140  end subroutine
141  subroutine f49 ()
142    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(seq_cst)})
143  end subroutine
144  subroutine f50 ()
145    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(relaxed)})
146  end subroutine
147  subroutine f51 ()
148    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(acq_rel)})
149  end subroutine
150  subroutine f52 ()
151    !$omp declare variant (f14) match (implementation={atomic_default_mem_order(acq_rel),vendor(gnu),&
152    !$omp&					       unified_address,extension(foobar)}) ! { dg-warning "unknown property 'foobar' of 'extension' selector" "" { target *-*-* } .-1 }
153  end subroutine
154  subroutine f53 ()
155    !$omp declare variant (f13) match (implementation={vendor(score(3):amd)})
156  end subroutine
157  subroutine f54 ()
158    !$omp declare variant (f13) match (implementation={vendor(score(4):"arm")})
159  end subroutine
160  subroutine f55 ()
161    !$omp declare variant (f13) match (implementation={vendor(score(5):bsc)})
162  end subroutine
163  subroutine f56 ()
164    !$omp declare variant (f13) match (implementation={vendor(score(6):cray)})
165  end subroutine
166  subroutine f57 ()
167    !$omp declare variant (f13) match (implementation={vendor(score(7):fujitsu)})
168  end subroutine
169  subroutine f58 ()
170    !$omp declare variant (f13) match (implementation={vendor(score(8):gnu)})
171  end subroutine
172  subroutine f59 ()
173    !$omp declare variant (f13) match (implementation={vendor(score(9):ibm)})
174  end subroutine
175  subroutine f60 ()
176    !$omp declare variant (f13) match (implementation={vendor(score(10):intel)})
177  end subroutine
178  subroutine f61 ()
179    !$omp declare variant (f13) match (implementation={vendor(score(11):llvm)})
180  end subroutine
181  subroutine f62 ()
182    !$omp declare variant (f13) match (implementation={vendor(score(12):pgi)})
183  end subroutine
184  subroutine f63 ()
185    !$omp declare variant (f13) match (implementation={vendor(score(13):"ti")})
186  end subroutine
187  subroutine f64 ()
188    !$omp declare variant (f13) match (implementation={vendor(score(14):unknown)})
189  end subroutine
190  subroutine f65 ()
191    !$omp declare variant (f13) match (implementation={vendor(score(15):gnu,llvm,intel,ibm)})
192  end subroutine
193  subroutine f66 ()
194    !$omp declare variant (f13) match (implementation={extension(score(16):my_cute_extension)})	! { dg-warning "unknown property 'my_cute_extension' of 'extension' selector" }
195  end subroutine
196  subroutine f67 ()
197    !$omp declare variant (f13) match (implementation={extension(score(17):some_other_ext,another_ext)})	! { dg-warning "unknown property 'some_other_ext' of 'extension' selector" }
198  end subroutine												! { dg-warning "unknown property 'another_ext' of 'extension' selector" "" { target *-*-* } .-1 }
199  subroutine f68 ()
200    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(score(18):seq_cst)})
201  end subroutine
202  subroutine f69 ()
203    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(score(19):relaxed)})
204  end subroutine
205  subroutine f70 ()
206    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(score(20):acq_rel)})
207  end subroutine
208  subroutine f71 ()
209    !$omp declare variant (f13) match (implementation={atomic_default_mem_order(score(21):acq_rel),&
210    !$omp&					       vendor(score(22):gnu),unified_address,extension(score(22):foobar)})	! { dg-warning "unknown property 'foobar' of 'extension' selector" "" { target *-*-* } .-1 }
211  end subroutine
212  subroutine f72 ()
213    !$omp declare variant (f13) match (user={condition(0)})
214  end subroutine
215  subroutine f73 ()
216    !$omp declare variant (f13) match (user={condition(272-272*1)})
217  end subroutine
218  subroutine f74 ()
219    !$omp declare variant (f13) match (user={condition(score(25):1)})
220  end subroutine
221  subroutine f75 ()
222    !$omp declare variant (f13) match (device={kind(any,"any")})
223  end subroutine
224  subroutine f76 ()
225    !$omp declare variant (f13) match (device={kind("any","any")})
226  end subroutine
227  subroutine f77 ()
228    !$omp declare variant (f13) match (device={kind("any",any)})
229  end subroutine
230  subroutine f78 ()
231    !$omp declare variant (f13) match (implementation={vendor(nvidia)})
232  end subroutine
233  subroutine f79 ()
234    !$omp declare variant (f13) match (user={condition(score(0):0)})
235  end subroutine
236
237  end module
238