1 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32i -x c -E -dM %s \
2 // RUN: -o - | FileCheck %s
3 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64i -x c -E -dM %s \
4 // RUN: -o - | FileCheck %s
6 // CHECK-NOT: __riscv_div
7 // CHECK-NOT: __riscv_m
8 // CHECK-NOT: __riscv_mul
9 // CHECK-NOT: __riscv_muldiv
10 // CHECK-NOT: __riscv_a 2000000{{$}}
11 // CHECK-NOT: __riscv_atomic
12 // CHECK-NOT: __riscv_f 2000000{{$}}
13 // CHECK-NOT: __riscv_d
14 // CHECK-NOT: __riscv_flen
15 // CHECK-NOT: __riscv_fdiv
16 // CHECK-NOT: __riscv_fsqrt
17 // CHECK-NOT: __riscv_c 2000000{{$}}
18 // CHECK-NOT: __riscv_compressed
19 // CHECK-NOT: __riscv_b
20 // CHECK-NOT: __riscv_bitmanip
21 // CHECK-NOT: __riscv_zihintntl
22 // CHECK-NOT: __riscv_zba
23 // CHECK-NOT: __riscv_zbb
24 // CHECK-NOT: __riscv_zbc
25 // CHECK-NOT: __riscv_zbs
26 // CHECK-NOT: __riscv_zfh
27 // CHECK-NOT: __riscv_v
28 // CHECK-NOT: __riscv_vector
29 // CHECK-NOT: __riscv_v_intrinsic
30 // CHECK-NOT: __riscv_zbkc
31 // CHECK-NOT: __riscv_zbkx
32 // CHECK-NOT: __riscv_zbkb
33 // CHECK-NOT: __riscv_zkne
34 // CHECK-NOT: __riscv_zknd
35 // CHECK-NOT: __riscv_zknh
36 // CHECK-NOT: __riscv_zksh
37 // CHECK-NOT: __riscv_zksed
38 // CHECK-NOT: __riscv_zkr
39 // CHECK-NOT: __riscv_zkt
40 // CHECK-NOT: __riscv_zk
41 // CHECK-NOT: __riscv_zicbom
42 // CHECK-NOT: __riscv_zicboz
43 // CHECK-NOT: __riscv_svnapot
44 // CHECK-NOT: __riscv_svpbmt
45 // CHECK-NOT: __riscv_svinval
46 // CHECK-NOT: __riscv_xventanacondops
47 // CHECK-NOT: __riscv_zca
48 // CHECK-NOT: __riscv_zcb
49 // CHECK-NOT: __riscv_zcd
50 // CHECK-NOT: __riscv_zcf
51 // CHECK-NOT: __riscv_h
53 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32im -x c -E -dM %s \
54 // RUN: -o - | FileCheck --check-prefix=CHECK-M-EXT %s
55 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64im -x c -E -dM %s \
56 // RUN: -o - | FileCheck --check-prefix=CHECK-M-EXT %s
57 // CHECK-M-EXT: __riscv_div 1
58 // CHECK-M-EXT: __riscv_m 2000000{{$}}
59 // CHECK-M-EXT: __riscv_mul 1
60 // CHECK-M-EXT: __riscv_muldiv 1
62 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ia -x c -E -dM %s \
63 // RUN: -o - | FileCheck --check-prefix=CHECK-A-EXT %s
64 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ia -x c -E -dM %s \
65 // RUN: -o - | FileCheck --check-prefix=CHECK-A-EXT %s
66 // CHECK-A-EXT: __riscv_a 2000000{{$}}
67 // CHECK-A-EXT: __riscv_atomic 1
69 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32if -x c -E -dM %s \
70 // RUN: -o - | FileCheck --check-prefix=CHECK-F-EXT %s
71 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64if -x c -E -dM %s \
72 // RUN: -o - | FileCheck --check-prefix=CHECK-F-EXT %s
73 // CHECK-F-EXT: __riscv_f 2000000{{$}}
74 // CHECK-F-EXT: __riscv_fdiv 1
75 // CHECK-F-EXT: __riscv_flen 32
76 // CHECK-F-EXT: __riscv_fsqrt 1
78 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -x c -E -dM %s \
79 // RUN: -o - | FileCheck --check-prefix=CHECK-D-EXT %s
80 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -x c -E -dM %s \
81 // RUN: -o - | FileCheck --check-prefix=CHECK-D-EXT %s
82 // CHECK-D-EXT: __riscv_d 2000000{{$}}
83 // CHECK-D-EXT: __riscv_fdiv 1
84 // CHECK-D-EXT: __riscv_flen 64
85 // CHECK-D-EXT: __riscv_fsqrt 1
87 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -mabi=ilp32 -x c -E -dM %s \
88 // RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
89 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -mabi=lp64 -x c -E -dM %s \
90 // RUN: -o - | FileCheck --check-prefix=CHECK-SOFT %s
91 // CHECK-SOFT: __riscv_float_abi_soft 1
92 // CHECK-SOFT-NOT: __riscv_float_abi_single
93 // CHECK-SOFT-NOT: __riscv_float_abi_double
95 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -mabi=ilp32f -x c -E -dM %s \
96 // RUN: -o - | FileCheck --check-prefix=CHECK-SINGLE %s
97 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -mabi=lp64f -x c -E -dM %s \
98 // RUN: -o - | FileCheck --check-prefix=CHECK-SINGLE %s
99 // CHECK-SINGLE: __riscv_float_abi_single 1
100 // CHECK-SINGLE-NOT: __riscv_float_abi_soft
101 // CHECK-SINGLE-NOT: __riscv_float_abi_double
103 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ifd -x c -E -dM %s \
104 // RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
105 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ifd -x c -E -dM %s \
106 // RUN: -o - | FileCheck --check-prefix=CHECK-DOUBLE %s
107 // CHECK-DOUBLE: __riscv_float_abi_double 1
108 // CHECK-DOUBLE-NOT: __riscv_float_abi_soft
109 // CHECK-DOUBLE-NOT: __riscv_float_abi_single
111 // RUN: %clang -target riscv32-unknown-linux-gnu -march=rv32ic -x c -E -dM %s \
112 // RUN: -o - | FileCheck --check-prefix=CHECK-C-EXT %s
113 // RUN: %clang -target riscv64-unknown-linux-gnu -march=rv64ic -x c -E -dM %s \
114 // RUN: -o - | FileCheck --check-prefix=CHECK-C-EXT %s
115 // CHECK-C-EXT: __riscv_c 2000000{{$}}
116 // CHECK-C-EXT: __riscv_compressed 1
118 // RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
119 // RUN: -march=rv32izihintntl0p2 -x c -E -dM %s \
120 // RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
121 // RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
122 // RUN: -march=rv64izihintntl0p2 -x c -E -dM %s \
123 // RUN: -o - | FileCheck --check-prefix=CHECK-ZIHINTNTL-EXT %s
124 // CHECK-ZIHINTNTL-EXT: __riscv_zihintntl 2000{{$}}
126 // RUN: %clang -target riscv32-unknown-linux-gnu \
127 // RUN: -march=rv32izba1p0 -x c -E -dM %s \
128 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
129 // RUN: %clang -target riscv32-unknown-linux-gnu \
130 // RUN: -march=rv32izba -x c -E -dM %s \
131 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
132 // RUN: %clang -target riscv64-unknown-linux-gnu \
133 // RUN: -march=rv64izba1p0 -x c -E -dM %s \
134 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
135 // RUN: %clang -target riscv64-unknown-linux-gnu \
136 // RUN: -march=rv64izba -x c -E -dM %s \
137 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBA-EXT %s
138 // CHECK-ZBA-NOT: __riscv_b
139 // CHECK-ZBA-EXT: __riscv_zba 1000000{{$}}
141 // RUN: %clang -target riscv32-unknown-linux-gnu \
142 // RUN: -march=rv32izbb1p0 -x c -E -dM %s \
143 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
144 // RUN: %clang -target riscv32-unknown-linux-gnu \
145 // RUN: -march=rv32izbb -x c -E -dM %s \
146 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
147 // RUN: %clang -target riscv64-unknown-linux-gnu \
148 // RUN: -march=rv64izbb1p0 -x c -E -dM %s \
149 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
150 // RUN: %clang -target riscv64-unknown-linux-gnu \
151 // RUN: -march=rv64izbb -x c -E -dM %s \
152 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBB-EXT %s
153 // CHECK-ZBB-NOT: __riscv_b
154 // CHECK-ZBB-EXT: __riscv_zbb 1000000{{$}}
156 // RUN: %clang -target riscv32-unknown-linux-gnu \
157 // RUN: -march=rv32izbc1p0 -x c -E -dM %s \
158 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
159 // RUN: %clang -target riscv32-unknown-linux-gnu \
160 // RUN: -march=rv32izbc -x c -E -dM %s \
161 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
162 // RUN: %clang -target riscv64-unknown-linux-gnu \
163 // RUN: -march=rv64izbc1p0 -x c -E -dM %s \
164 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
165 // RUN: %clang -target riscv64-unknown-linux-gnu \
166 // RUN: -march=rv64izbc -x c -E -dM %s \
167 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBC-EXT %s
168 // CHECK-ZBC-NOT: __riscv_b
169 // CHECK-ZBC-EXT: __riscv_zbc 1000000{{$}}
171 // RUN: %clang -target riscv32-unknown-linux-gnu \
172 // RUN: -march=rv32izbs1p0 -x c -E -dM %s \
173 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
174 // RUN: %clang -target riscv32-unknown-linux-gnu \
175 // RUN: -march=rv32izbs -x c -E -dM %s \
176 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
177 // RUN: %clang -target riscv64-unknown-linux-gnu \
178 // RUN: -march=rv64izbs1p0 -x c -E -dM %s \
179 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
180 // RUN: %clang -target riscv64-unknown-linux-gnu \
181 // RUN: -march=rv64izbs -x c -E -dM %s \
182 // RUN: -o - | FileCheck --check-prefix=CHECK-ZBS-EXT %s
183 // CHECK-ZBS-NOT: __riscv_b
184 // CHECK-ZBS-EXT: __riscv_zbs 1000000{{$}}
186 // RUN: %clang -target riscv32-unknown-linux-gnu \
187 // RUN: -march=rv32iv1p0 -x c -E -dM %s \
188 // RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
189 // RUN: %clang -target riscv64-unknown-linux-gnu \
190 // RUN: -march=rv64iv1p0 -x c -E -dM %s \
191 // RUN: -o - | FileCheck --check-prefix=CHECK-V-EXT %s
192 // CHECK-V-EXT: __riscv_v 1000000{{$}}
193 // CHECK-V-EXT: __riscv_vector 1
195 // RUN: %clang -target riscv32-unknown-linux-gnu \
196 // RUN: -march=rv32izfhmin1p0 -x c -E -dM %s \
197 // RUN: -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
198 // RUN: %clang -target riscv64-unknown-linux-gnu \
199 // RUN: -march=rv64izfhmin1p0 -x c -E -dM %s \
200 // RUN: -o - | FileCheck --check-prefix=CHECK-ZFHMIN-EXT %s
201 // CHECK-ZFHMIN-EXT: __riscv_f 2000000{{$}}
202 // CHECK-ZFHMIN-EXT: __riscv_zfhmin 1000000{{$}}
204 // RUN: %clang -target riscv32-unknown-linux-gnu \
205 // RUN: -march=rv32izfh1p0 -x c -E -dM %s \
206 // RUN: -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
207 // RUN: %clang -target riscv64-unknown-linux-gnu \
208 // RUN: -march=rv64izfh1p0 -x c -E -dM %s \
209 // RUN: -o - | FileCheck --check-prefix=CHECK-ZFH-EXT %s
210 // CHECK-ZFH-EXT: __riscv_f 2000000{{$}}
211 // CHECK-ZFH-EXT: __riscv_zfh 1000000{{$}}
213 // RUN: %clang -target riscv32-unknown-linux-gnu \
214 // RUN: -march=rv64iv1p0 -x c -E -dM %s -o - \
215 // RUN: | FileCheck --check-prefix=CHECK-V-MINVLEN %s
216 // CHECK-V-MINVLEN: __riscv_v_elen 64
217 // CHECK-V-MINVLEN: __riscv_v_elen_fp 64
218 // CHECK-V-MINVLEN: __riscv_v_min_vlen 128
220 // RUN: %clang -target riscv32-unknown-linux-gnu \
221 // RUN: -march=rv64iv1p0_zvl256b1p0 -x c -E -dM %s -o - \
222 // RUN: | FileCheck --check-prefix=CHECK-ZVL256b %s
223 // CHECK-ZVL256b: __riscv_v_min_vlen 256
225 // RUN: %clang -target riscv32-unknown-linux-gnu \
226 // RUN: -march=rv64iv1p0_zvl512b1p0 -x c -E -dM %s -o - \
227 // RUN: | FileCheck --check-prefix=CHECK-ZVL512b %s
228 // CHECK-ZVL512b: __riscv_v_min_vlen 512
230 // RUN: %clang -target riscv32-unknown-linux-gnu \
231 // RUN: -march=rv64iv1p0_zvl1024b1p0 -x c -E -dM %s -o - \
232 // RUN: | FileCheck --check-prefix=CHECK-ZVL1024b %s
233 // CHECK-ZVL1024b: __riscv_v_min_vlen 1024
235 // RUN: %clang -target riscv32-unknown-linux-gnu \
236 // RUN: -march=rv64iv1p0_zvl2048b1p0 -x c -E -dM %s -o - \
237 // RUN: | FileCheck --check-prefix=CHECK-ZVL2048b %s
238 // CHECK-ZVL2048b: __riscv_v_min_vlen 2048
240 // RUN: %clang -target riscv32-unknown-linux-gnu \
241 // RUN: -march=rv64iv1p0_zvl4096b1p0 -x c -E -dM %s -o - \
242 // RUN: | FileCheck --check-prefix=CHECK-ZVL4096b %s
243 // CHECK-ZVL4096b: __riscv_v_min_vlen 4096
245 // RUN: %clang -target riscv32-unknown-linux-gnu \
246 // RUN: -march=rv64iv1p0_zvl8192b1p0 -x c -E -dM %s -o - \
247 // RUN: | FileCheck --check-prefix=CHECK-ZVL8192b %s
248 // CHECK-ZVL8192b: __riscv_v_min_vlen 8192
250 // RUN: %clang -target riscv32-unknown-linux-gnu \
251 // RUN: -march=rv64iv1p0_zvl16384b1p0 -x c -E -dM %s -o - \
252 // RUN: | FileCheck --check-prefix=CHECK-ZVL16384b %s
253 // CHECK-ZVL16384b: __riscv_v_min_vlen 16384
255 // RUN: %clang -target riscv32-unknown-linux-gnu \
256 // RUN: -march=rv64iv1p0_zvl32768b1p0 -x c -E -dM %s -o - \
257 // RUN: | FileCheck --check-prefix=CHECK-ZVL32768b %s
258 // CHECK-ZVL32768b: __riscv_v_min_vlen 32768
260 // RUN: %clang -target riscv32-unknown-linux-gnu \
261 // RUN: -march=rv64iv1p0_zvl65536b1p0 -x c -E -dM %s -o - \
262 // RUN: | FileCheck --check-prefix=CHECK-ZVL65536b %s
263 // CHECK-ZVL65536b: __riscv_v_min_vlen 65536
265 // RUN: %clang -target riscv64-unknown-linux-gnu \
266 // RUN: -march=rv64ifdzve64d1p0 -x c -E -dM %s -o - \
267 // RUN: | FileCheck --check-prefix=CHECK-ZVE64D-EXT %s
268 // CHECK-ZVE64D-EXT: __riscv_v_elen 64
269 // CHECK-ZVE64D-EXT: __riscv_v_elen_fp 64
270 // CHECK-ZVE64D-EXT: __riscv_v_intrinsic 11000{{$}}
271 // CHECK-ZVE64D-EXT: __riscv_v_min_vlen 64
272 // CHECK-ZVE64D-EXT: __riscv_vector 1
273 // CHECK-ZVE64D-EXT: __riscv_zve32f 1000000{{$}}
274 // CHECK-ZVE64D-EXT: __riscv_zve32x 1000000{{$}}
275 // CHECK-ZVE64D-EXT: __riscv_zve64d 1000000{{$}}
276 // CHECK-ZVE64D-EXT: __riscv_zve64f 1000000{{$}}
277 // CHECK-ZVE64D-EXT: __riscv_zve64x 1000000{{$}}
279 // RUN: %clang -target riscv64-unknown-linux-gnu \
280 // RUN: -march=rv64ifzve64f1p0 -x c -E -dM %s -o - \
281 // RUN: | FileCheck --check-prefix=CHECK-ZVE64F-EXT %s
282 // CHECK-ZVE64F-EXT: __riscv_v_elen 64
283 // CHECK-ZVE64F-EXT: __riscv_v_elen_fp 32
284 // CHECK-ZVE64F-EXT: __riscv_v_intrinsic 11000{{$}}
285 // CHECK-ZVE64F-EXT: __riscv_v_min_vlen 64
286 // CHECK-ZVE64F-EXT: __riscv_vector 1
287 // CHECK-ZVE64F-EXT: __riscv_zve32f 1000000{{$}}
288 // CHECK-ZVE64F-EXT: __riscv_zve32x 1000000{{$}}
289 // CHECK-ZVE64F-EXT: __riscv_zve64f 1000000{{$}}
290 // CHECK-ZVE64F-EXT: __riscv_zve64x 1000000{{$}}
292 // RUN: %clang -target riscv64-unknown-linux-gnu \
293 // RUN: -march=rv64izve64x1p0 -x c -E -dM %s -o - \
294 // RUN: | FileCheck --check-prefix=CHECK-ZVE64X-EXT %s
295 // CHECK-ZVE64X-EXT: __riscv_v_elen 64
296 // CHECK-ZVE64X-EXT: __riscv_v_elen_fp 0
297 // CHECK-ZVE64X-EXT: __riscv_v_intrinsic 11000{{$}}
298 // CHECK-ZVE64X-EXT: __riscv_v_min_vlen 64
299 // CHECK-ZVE64X-EXT: __riscv_vector 1
300 // CHECK-ZVE64X-EXT: __riscv_zve32x 1000000{{$}}
301 // CHECK-ZVE64X-EXT: __riscv_zve64x 1000000{{$}}
303 // RUN: %clang -target riscv64-unknown-linux-gnu \
304 // RUN: -march=rv64ifzve32f1p0 -x c -E -dM %s -o - \
305 // RUN: | FileCheck --check-prefix=CHECK-ZVE32F-EXT %s
306 // CHECK-ZVE32F-EXT: __riscv_v_elen 32
307 // CHECK-ZVE32F-EXT: __riscv_v_elen_fp 32
308 // CHECK-ZVE32F-EXT: __riscv_v_intrinsic 11000{{$}}
309 // CHECK-ZVE32F-EXT: __riscv_v_min_vlen 32
310 // CHECK-ZVE32F-EXT: __riscv_vector 1
311 // CHECK-ZVE32F-EXT: __riscv_zve32f 1000000{{$}}
312 // CHECK-ZVE32F-EXT: __riscv_zve32x 1000000{{$}}
314 // RUN: %clang -target riscv64-unknown-linux-gnu \
315 // RUN: -march=rv64izve32x1p0 -x c -E -dM %s -o - \
316 // RUN: | FileCheck --check-prefix=CHECK-ZVE32X-EXT %s
317 // CHECK-ZVE32X-EXT: __riscv_v_elen 32
318 // CHECK-ZVE32X-EXT: __riscv_v_elen_fp 0
319 // CHECK-ZVE32X-EXT: __riscv_v_intrinsic 11000{{$}}
320 // CHECK-ZVE32X-EXT: __riscv_v_min_vlen 32
321 // CHECK-ZVE32X-EXT: __riscv_vector 1
322 // CHECK-ZVE32X-EXT: __riscv_zve32x 1000000{{$}}
324 // RUN: %clang -target riscv64-unknown-linux-gnu \
325 // RUN: -march=rv64izbkc1p0 -x c -E -dM %s -o - \
326 // RUN: | FileCheck --check-prefix=CHECK-ZBKC-EXT %s
327 // CHECK-ZBKC-EXT: __riscv_zbkc
329 // RUN: %clang -target riscv64-unknown-linux-gnu \
330 // RUN: -march=rv64izbkx1p0 -x c -E -dM %s -o - \
331 // RUN: | FileCheck --check-prefix=CHECK-ZBKX-EXT %s
332 // CHECK-ZBKX-EXT: __riscv_zbkx
334 // RUN: %clang -target riscv64-unknown-linux-gnu \
335 // RUN: -march=rv64izbkb1p0 -x c -E -dM %s -o - \
336 // RUN: | FileCheck --check-prefix=CHECK-ZBKB-EXT %s
337 // CHECK-ZBKB-EXT: __riscv_zbkb
339 // RUN: %clang -target riscv64-unknown-linux-gnu \
340 // RUN: -march=rv64izknd1p0 -x c -E -dM %s -o - \
341 // RUN: | FileCheck --check-prefix=CHECK-ZKND-EXT %s
342 // CHECK-ZKND-EXT: __riscv_zknd
344 // RUN: %clang -target riscv64-unknown-linux-gnu \
345 // RUN: -march=rv64izkne1p0 -x c -E -dM %s -o - \
346 // RUN: | FileCheck --check-prefix=CHECK-ZKNE-EXT %s
347 // CHECK-ZKNE-EXT: __riscv_zkne
349 // RUN: %clang -target riscv64-unknown-linux-gnu \
350 // RUN: -march=rv64izknh1p0 -x c -E -dM %s -o - \
351 // RUN: | FileCheck --check-prefix=CHECK-ZKNH-EXT %s
352 // CHECK-ZKNH-EXT: __riscv_zknh
354 // RUN: %clang -target riscv64-unknown-linux-gnu \
355 // RUN: -march=rv64izksh1p0 -x c -E -dM %s -o - \
356 // RUN: | FileCheck --check-prefix=CHECK-ZKSH-EXT %s
357 // CHECK-ZKSH-EXT: __riscv_zksh
359 // RUN: %clang -target riscv64-unknown-linux-gnu \
360 // RUN: -march=rv64izksed1p0 -x c -E -dM %s -o - \
361 // RUN: | FileCheck --check-prefix=CHECK-ZKSED-EXT %s
362 // CHECK-ZKSED-EXT: __riscv_zksed
364 // RUN: %clang -target riscv64-unknown-linux-gnu \
365 // RUN: -march=rv64izkr1p0 -x c -E -dM %s -o - \
366 // RUN: | FileCheck --check-prefix=CHECK-ZKR-EXT %s
367 // CHECK-ZKR-EXT: __riscv_zkr
369 // RUN: %clang -target riscv64-unknown-linux-gnu \
370 // RUN: -march=rv64izkt1p0 -x c -E -dM %s -o - \
371 // RUN: | FileCheck --check-prefix=CHECK-ZKT-EXT %s
372 // CHECK-ZKT-EXT: __riscv_zkt
374 // RUN: %clang -target riscv64-unknown-linux-gnu \
375 // RUN: -march=rv64izk1p0 -x c -E -dM %s -o - \
376 // RUN: | FileCheck --check-prefix=CHECK-ZK-EXT %s
377 // CHECK-ZK-EXT: __riscv_zk
379 // RUN: %clang -target riscv32-unknown-linux-gnu \
380 // RUN: -march=rv32i_zkn_zkt_zkr -x c -E -dM %s -o - \
381 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
382 // RUN: %clang -target riscv64-unknown-linux-gnu \
383 // RUN: -march=rv64i_zkn_zkt_zkr -x c -E -dM %s -o - \
384 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZK %s
385 // CHECK-COMBINE-INTO-ZK: __riscv_zk 1
387 // RUN: %clang -target riscv32-unknown-linux-gnu \
388 // RUN: -march=rv32i_zbkb_zbkc_zbkx_zkne_zknd_zknh -x c -E -dM %s -o - \
389 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
390 // RUN: %clang -target riscv64-unknown-linux-gnu \
391 // RUN: -march=rv64i_zbkb_zbkc_zbkx_zkne_zknd_zknh -x c -E -dM %s -o - \
392 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKN %s
393 // CHECK-COMBINE-INTO-ZKN: __riscv_zkn 1
395 // RUN: %clang -target riscv32-unknown-linux-gnu \
396 // RUN: -march=rv32i_zbkb_zbkc_zbkx_zksed_zksh -x c -E -dM %s -o - \
397 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
398 // RUN: %clang -target riscv64-unknown-linux-gnu \
399 // RUN: -march=rv64i_zbkb_zbkc_zbkx_zksed_zksh -x c -E -dM %s -o - \
400 // RUN: | FileCheck --check-prefix=CHECK-COMBINE-INTO-ZKS %s
401 // CHECK-COMBINE-INTO-ZKS: __riscv_zks 1
403 // RUN: %clang -target riscv32 -march=rv32izicbom -x c -E -dM %s \
404 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
405 // RUN: %clang -target riscv64 -march=rv64izicbom -x c -E -dM %s \
406 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOM-EXT %s
407 // CHECK-ZICBOM-EXT: __riscv_zicbom 1000000{{$}}
409 // RUN: %clang -target riscv32 -march=rv32izicboz -x c -E -dM %s \
410 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
411 // RUN: %clang -target riscv64 -march=rv64izicboz -x c -E -dM %s \
412 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOZ-EXT %s
413 // CHECK-ZICBOZ-EXT: __riscv_zicboz 1000000{{$}}
415 // RUN: %clang -target riscv32 -march=rv32izicbop -x c -E -dM %s \
416 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
417 // RUN: %clang -target riscv64 -march=rv64izicbop -x c -E -dM %s \
418 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICBOP-EXT %s
419 // CHECK-ZICBOP-EXT: __riscv_zicbop 1000000{{$}}
421 // RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
422 // RUN: -march=rv32izawrs1p0 -x c -E -dM %s \
423 // RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
424 // RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
425 // RUN: -march=rv64izawrs1p0 -x c -E -dM %s \
426 // RUN: -o - | FileCheck --check-prefix=CHECK-ZAWRS-EXT %s
427 // CHECK-ZAWRS-EXT: __riscv_zawrs 1000000{{$}}
429 // RUN: %clang -target riscv32-unknown-linux-gnu -menable-experimental-extensions \
430 // RUN: -march=rv32iztso0p1 -x c -E -dM %s \
431 // RUN: -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
432 // RUN: %clang -target riscv64-unknown-linux-gnu -menable-experimental-extensions \
433 // RUN: -march=rv64iztso0p1 -x c -E -dM %s \
434 // RUN: -o - | FileCheck --check-prefix=CHECK-ZTSO-EXT %s
435 // CHECK-ZTSO-EXT: __riscv_ztso 1000{{$}}
437 // RUN: %clang -target riscv32 -march=rv32isvnapot -x c -E -dM %s \
438 // RUN: -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
439 // RUN: %clang -target riscv64 -march=rv64isvnapot -x c -E -dM %s \
440 // RUN: -o - | FileCheck --check-prefix=CHECK-SVNAPOT-EXT %s
441 // CHECK-SVNAPOT-EXT: __riscv_svnapot 1000000{{$}}
443 // RUN: %clang -target riscv32 -march=rv32isvpbmt -x c -E -dM %s \
444 // RUN: -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
445 // RUN: %clang -target riscv64 -march=rv64isvpbmt -x c -E -dM %s \
446 // RUN: -o - | FileCheck --check-prefix=CHECK-SVPBMT-EXT %s
447 // CHECK-SVPBMT-EXT: __riscv_svpbmt 1000000{{$}}
449 // RUN: %clang -target riscv32 -march=rv32isvinval -x c -E -dM %s \
450 // RUN: -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
451 // RUN: %clang -target riscv64 -march=rv64isvinval -x c -E -dM %s \
452 // RUN: -o - | FileCheck --check-prefix=CHECK-SVINVAL-EXT %s
453 // CHECK-SVINVAL-EXT: __riscv_svinval 1000000{{$}}
455 // RUN: %clang -target riscv32 -march=rv32ih -x c -E -dM %s \
456 // RUN: -o - | FileCheck --check-prefix=CHECK-H-EXT %s
457 // RUN: %clang -target riscv64 -march=rv64ih -x c -E -dM %s \
458 // RUN: -o - | FileCheck --check-prefix=CHECK-H-EXT %s
459 // CHECK-H-EXT: __riscv_h 1000000{{$}}
461 // RUN: %clang -target riscv64 -march=rv64ixventanacondops -x c -E -dM %s \
462 // RUN: -o - | FileCheck --check-prefix=CHECK-XVENTANACONDOPS-EXT %s
463 // CHECK-XVENTANACONDOPS-EXT: __riscv_xventanacondops 1000000{{$}}
465 // RUN: %clang -target riscv64 -march=rv64ixtheadvdot -x c -E -dM %s \
466 // RUN: -o - | FileCheck --check-prefix=CHECK-XTHEADVDOT-EXT %s
467 // CHECK-XTHEADVDOT-EXT: __riscv_xtheadvdot 1000000{{$}}
469 // RUN: %clang -target riscv32 -march=rv32izca1p0 -menable-experimental-extensions \
470 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
471 // RUN: %clang -target riscv64 -march=rv64izca1p0 -menable-experimental-extensions \
472 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCA-EXT %s
473 // CHECK-ZCA-EXT: __riscv_zca 1000000{{$}}
475 // RUN: %clang -target riscv32 -march=rv32izcb1p0 -menable-experimental-extensions \
476 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
477 // RUN: %clang -target riscv64 -march=rv64izcb1p0 -menable-experimental-extensions \
478 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCB-EXT %s
479 // CHECK-ZCB-EXT: __riscv_zca 1000000{{$}}
480 // CHECK-ZCB-EXT: __riscv_zcb 1000000{{$}}
482 // RUN: %clang -target riscv32 -march=rv32izcd1p0 -menable-experimental-extensions \
483 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
484 // RUN: %clang -target riscv64 -march=rv64izcd1p0 -menable-experimental-extensions \
485 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCD-EXT %s
486 // CHECK-ZCD-EXT: __riscv_zcd 1000000{{$}}
488 // RUN: %clang -target riscv32 -march=rv32izcf1p0 -menable-experimental-extensions \
489 // RUN: -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-ZCF-EXT %s
490 // CHECK-ZCF-EXT: __riscv_zcf 1000000{{$}}