Debian Codegraph @

clang/test/Driver/riscv-cpus.c

raw
1 // Check target CPUs are correctly passed.
2
3 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=rocket-rv32 | FileCheck -check-prefix=MCPU-ROCKET32 %s
4 // MCPU-ROCKET32: "-nostdsysteminc" "-target-cpu" "rocket-rv32"
5 // MCPU-ROCKET32: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
6
7 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=rocket-rv64 | FileCheck -check-prefix=MCPU-ROCKET64 %s
8 // MCPU-ROCKET64: "-nostdsysteminc" "-target-cpu" "rocket-rv64"
9 // MCPU-ROCKET64: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
10
11 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=syntacore-scr1-base | FileCheck -check-prefix=MCPU-SYNTACORE-SCR1-BASE %s
12 // MCPU-SYNTACORE-SCR1-BASE: "-target-cpu" "syntacore-scr1-base"
13 // MCPU-SYNTACORE-SCR1-BASE: "-target-feature" "+c"
14 // MCPU-SYNTACORE-SCR1-BASE: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
15 // MCPU-SYNTACORE-SCR1-BASE: "-target-abi" "ilp32"
16
17 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=syntacore-scr1-max | FileCheck -check-prefix=MCPU-SYNTACORE-SCR1-MAX %s
18 // MCPU-SYNTACORE-SCR1-MAX: "-target-cpu" "syntacore-scr1-max"
19 // MCPU-SYNTACORE-SCR1-MAX: "-target-feature" "+m" "-target-feature" "+c"
20 // MCPU-SYNTACORE-SCR1-MAX: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
21 // MCPU-SYNTACORE-SCR1-MAX: "-target-abi" "ilp32"
22
23 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=xiangshan-nanhu | FileCheck -check-prefix=MCPU-XIANGSHAN-NANHU %s
24 // MCPU-XIANGSHAN-NANHU: "-nostdsysteminc" "-target-cpu" "xiangshan-nanhu"
25 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
26 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+c"
27 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+zicbom" "-target-feature" "+zicboz" "-target-feature" "+zicsr" "-target-feature" "+zifencei"
28 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+zba" "-target-feature" "+zbb" "-target-feature" "+zbc"
29 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+zbkb" "-target-feature" "+zbkc" "-target-feature" "+zbkx" "-target-feature" "+zbs"
30 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+zkn" "-target-feature" "+zknd" "-target-feature" "+zkne" "-target-feature" "+zknh"
31 // MCPU-XIANGSHAN-NANHU-SAME: "-target-feature" "+zks" "-target-feature" "+zksed" "-target-feature" "+zksh" "-target-feature" "+svinval"
32 // MCPU-XIANGSHAN-NANHU-SAME: "-target-abi" "lp64d"
33
34 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=spacemit-x60 | FileCheck -check-prefix=MCPU-SPACEMIT-X60 %s
35 // MCPU-SPACEMIT-X60: "-nostdsysteminc" "-target-cpu" "spacemit-x60"
36 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+m"
37 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+a"
38 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+f"
39 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+d"
40 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+c"
41 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+v"
42 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zic64b"
43 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicbom"
44 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicbop"
45 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicboz"
46 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+ziccamoa"
47 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+ziccif"
48 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicclsm"
49 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+ziccrse"
50 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicntr"
51 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicond"
52 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zicsr"
53 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zifencei"
54 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zihintpause"
55 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zihpm"
56 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+za64rs"
57 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zfh"
58 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zfhmin"
59 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zba"
60 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zbb"
61 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zbc"
62 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zbkc"
63 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zbs"
64 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zkt"
65 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zve32f"
66 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zve32x"
67 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zve64d"
68 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zve64f"
69 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zve64x"
70 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvfh"
71 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvfhmin"
72 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvkt"
73 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvl128b"
74 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvl256b"
75 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvl32b"
76 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+zvl64b"
77 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+ssccptr"
78 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+sscofpmf"
79 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+sscounterenw"
80 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+sstc"
81 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+sstvala"
82 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+sstvecd"
83 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+svade"
84 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+svbare"
85 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+svinval"
86 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+svnapot"
87 // MCPU-SPACEMIT-X60-SAME: "-target-feature" "+svpbmt"
88 // MCPU-SPACEMIT-X60-SAME: "-target-abi" "lp64d"
89
90 // We cannot check much for -mcpu=native, but it should be replaced by a valid CPU string.
91 // RUN: %clang --target=riscv64 -### -c %s -mcpu=native 2> %t.err || true
92 // RUN: FileCheck --input-file=%t.err -check-prefix=MCPU-NATIVE %s
93 // MCPU-NATIVE-NOT: "-target-cpu" "native"
94
95 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=rocket-rv32 | FileCheck -check-prefix=MTUNE-ROCKET32 %s
96 // MTUNE-ROCKET32: "-tune-cpu" "rocket-rv32"
97
98 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=rocket-rv64 | FileCheck -check-prefix=MTUNE-ROCKET64 %s
99 // MTUNE-ROCKET64: "-tune-cpu" "rocket-rv64"
100
101 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-base | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-BASE %s
102 // MTUNE-SYNTACORE-SCR1-BASE: "-tune-cpu" "syntacore-scr1-base"
103
104 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr1-max | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR1-MAX %s
105 // MTUNE-SYNTACORE-SCR1-MAX: "-tune-cpu" "syntacore-scr1-max"
106
107 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=veyron-v1 | FileCheck -check-prefix=MCPU-VEYRON-V1 %s
108 // MCPU-VEYRON-V1: "-target-cpu" "veyron-v1"
109 // MCPU-VEYRON-V1: "-target-feature" "+m"
110 // MCPU-VEYRON-V1: "-target-feature" "+a"
111 // MCPU-VEYRON-V1: "-target-feature" "+f"
112 // MCPU-VEYRON-V1: "-target-feature" "+d"
113 // MCPU-VEYRON-V1: "-target-feature" "+c"
114 // MCPU-VEYRON-V1: "-target-feature" "+zicbom"
115 // MCPU-VEYRON-V1: "-target-feature" "+zicbop"
116 // MCPU-VEYRON-V1: "-target-feature" "+zicboz"
117 // MCPU-VEYRON-V1: "-target-feature" "+zicntr"
118 // MCPU-VEYRON-V1: "-target-feature" "+zicsr"
119 // MCPU-VEYRON-V1: "-target-feature" "+zifencei"
120 // MCPU-VEYRON-V1: "-target-feature" "+zihintpause"
121 // MCPU-VEYRON-V1: "-target-feature" "+zihpm"
122 // MCPU-VEYRON-V1: "-target-feature" "+zba"
123 // MCPU-VEYRON-V1: "-target-feature" "+zbb"
124 // MCPU-VEYRON-V1: "-target-feature" "+zbc"
125 // MCPU-VEYRON-V1: "-target-feature" "+zbs"
126 // MCPU-VEYRON-V1: "-target-feature" "+xventanacondops"
127 // MCPU-VEYRON-V1: "-target-abi" "lp64d"
128
129 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=veyron-v1 | FileCheck -check-prefix=MTUNE-VEYRON-V1 %s
130 // MTUNE-VEYRON-V1: "-tune-cpu" "veyron-v1"
131
132 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=xiangshan-nanhu | FileCheck -check-prefix=MTUNE-XIANGSHAN-NANHU %s
133 // MTUNE-XIANGSHAN-NANHU: "-tune-cpu" "xiangshan-nanhu"
134
135 // Check mtune alias CPU has resolved to the right CPU according XLEN.
136 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=generic | FileCheck -check-prefix=MTUNE-GENERIC-32 %s
137 // MTUNE-GENERIC-32: "-tune-cpu" "generic"
138
139 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=generic | FileCheck -check-prefix=MTUNE-GENERIC-64 %s
140 // MTUNE-GENERIC-64: "-tune-cpu" "generic"
141
142 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=rocket | FileCheck -check-prefix=MTUNE-ROCKET-32 %s
143 // MTUNE-ROCKET-32: "-tune-cpu" "rocket"
144
145 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=rocket | FileCheck -check-prefix=MTUNE-ROCKET-64 %s
146 // MTUNE-ROCKET-64: "-tune-cpu" "rocket"
147
148 // We cannot check much for -mtune=native, but it should be replaced by a valid CPU string.
149 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=native | FileCheck -check-prefix=MTUNE-NATIVE %s
150 // MTUNE-NATIVE-NOT: "-tune-cpu" "native"
151
152 // mcpu with default march
153 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e20 | FileCheck -check-prefix=MCPU-SIFIVE-E20 %s
154 // MCPU-SIFIVE-E20: "-nostdsysteminc" "-target-cpu" "sifive-e20"
155 // MCPU-SIFIVE-E20: "-target-feature" "+m" "-target-feature" "+c"
156 // MCPU-SIFIVE-E20: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
157 // MCPU-SIFIVE-E20: "-target-abi" "ilp32"
158
159 // mcpu with default march
160 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e21 | FileCheck -check-prefix=MCPU-SIFIVE-E21 %s
161 // MCPU-SIFIVE-E21: "-nostdsysteminc" "-target-cpu" "sifive-e21"
162 // MCPU-SIFIVE-E21: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+c"
163 // MCPU-SIFIVE-E21: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
164 // MCPU-SIFIVE-E21: "-target-abi" "ilp32"
165
166 // mcpu with default march
167 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e24 | FileCheck -check-prefix=MCPU-SIFIVE-E24 %s
168 // MCPU-SIFIVE-E24: "-nostdsysteminc" "-target-cpu" "sifive-e24"
169 // MCPU-SIFIVE-E24: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f"
170 // MCPU-SIFIVE-E24: "-target-feature" "+c"
171 // MCPU-SIFIVE-E24: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
172 // MCPU-SIFIVE-E24: "-target-abi" "ilp32f"
173
174 // mcpu with default march
175 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e34 | FileCheck -check-prefix=MCPU-SIFIVE-E34 %s
176 // MCPU-SIFIVE-E34: "-nostdsysteminc" "-target-cpu" "sifive-e34"
177 // MCPU-SIFIVE-E34: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f"
178 // MCPU-SIFIVE-E34: "-target-feature" "+c"
179 // MCPU-SIFIVE-E34: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
180 // MCPU-SIFIVE-E34: "-target-abi" "ilp32f"
181
182 // mcpu with mabi option
183 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s21 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-S21 %s
184 // MCPU-ABI-SIFIVE-S21: "-nostdsysteminc" "-target-cpu" "sifive-s21"
185 // MCPU-ABI-SIFIVE-S21: "-target-feature" "+m" "-target-feature" "+a"
186 // MCPU-ABI-SIFIVE-S21: "-target-feature" "+c"
187 // MCPU-ABI-SIFIVE-S21: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
188 // MCPU-ABI-SIFIVE-S21: "-target-abi" "lp64"
189
190 // mcpu with mabi option
191 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s51 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-S51 %s
192 // MCPU-ABI-SIFIVE-S51: "-nostdsysteminc" "-target-cpu" "sifive-s51"
193 // MCPU-ABI-SIFIVE-S51: "-target-feature" "+m" "-target-feature" "+a"
194 // MCPU-ABI-SIFIVE-S51: "-target-feature" "+c"
195 // MCPU-ABI-SIFIVE-S51: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
196 // MCPU-ABI-SIFIVE-S51: "-target-abi" "lp64"
197
198 // mcpu with default march
199 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s54 | FileCheck -check-prefix=MCPU-SIFIVE-S54 %s
200 // MCPU-SIFIVE-S54: "-nostdsysteminc" "-target-cpu" "sifive-s54"
201 // MCPU-SIFIVE-S54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
202 // MCPU-SIFIVE-S54: "-target-feature" "+c"
203 // MCPU-SIFIVE-S54: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
204 // MCPU-SIFIVE-S54: "-target-abi" "lp64d"
205
206 // mcpu with mabi option
207 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s76 | FileCheck -check-prefix=MCPU-SIFIVE-S76 %s
208 // MCPU-SIFIVE-S76: "-nostdsysteminc" "-target-cpu" "sifive-s76"
209 // MCPU-SIFIVE-S76: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
210 // MCPU-SIFIVE-S76: "-target-feature" "+c"
211 // MCPU-SIFIVE-S76: "-target-feature" "+zicsr" "-target-feature" "+zifencei" "-target-feature" "+zihintpause"
212 // MCPU-SIFIVE-S76: "-target-abi" "lp64d"
213
214 // mcpu with default march
215 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u54 | FileCheck -check-prefix=MCPU-SIFIVE-U54 %s
216 // MCPU-SIFIVE-U54: "-nostdsysteminc" "-target-cpu" "sifive-u54"
217 // MCPU-SIFIVE-U54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
218 // MCPU-SIFIVE-U54: "-target-feature" "+c"
219 // MCPU-SIFIVE-U54: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
220 // MCPU-SIFIVE-U54: "-target-abi" "lp64d"
221
222 // mcpu with mabi option
223 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u54 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-U54 %s
224 // MCPU-ABI-SIFIVE-U54: "-nostdsysteminc" "-target-cpu" "sifive-u54"
225 // MCPU-ABI-SIFIVE-U54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
226 // MCPU-ABI-SIFIVE-U54: "-target-feature" "+c"
227 // MCPU-ABI-SIFIVE-U54: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
228 // MCPU-ABI-SIFIVE-U54: "-target-abi" "lp64"
229
230 // mcpu with default march
231 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e76 | FileCheck -check-prefix=MCPU-SIFIVE-E76 %s
232 // MCPU-SIFIVE-E76: "-nostdsysteminc" "-target-cpu" "sifive-e76"
233 // MCPU-SIFIVE-E76: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f"
234 // MCPU-SIFIVE-E76: "-target-feature" "+c"
235 // MCPU-SIFIVE-E76: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
236 // MCPU-SIFIVE-E76: "-target-abi" "ilp32f"
237
238 // mcpu with mabi option
239 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u74 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-U74 %s
240 // MCPU-ABI-SIFIVE-U74: "-nostdsysteminc" "-target-cpu" "sifive-u74"
241 // MCPU-ABI-SIFIVE-U74: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
242 // MCPU-ABI-SIFIVE-U74: "-target-feature" "+c"
243 // MCPU-ABI-SIFIVE-U74: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
244 // MCPU-ABI-SIFIVE-U74: "-target-abi" "lp64"
245
246 // march overwrite mcpu's default march
247 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=sifive-e31 -march=rv32imc | FileCheck -check-prefix=MCPU-MARCH %s
248 // MCPU-MARCH: "-nostdsysteminc" "-target-cpu" "sifive-e31" "-target-feature" "+m" "-target-feature" "+c"
249 // MCPU-MARCH: "-target-abi" "ilp32"
250
251 // Check interaction between mcpu and mtune, mtune won't affect arch related
252 // target feature, but mcpu will.
253 //
254 // In this case, sifive-e31 is rv32imac, sifive-e76 is rv32imafc, so F-extension
255 // should not enabled.
256 //
257 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=sifive-e31 -mtune=sifive-e76 | FileCheck -check-prefix=MTUNE-E31-MCPU-E76 %s
258 // MTUNE-E31-MCPU-E76: "-target-cpu" "sifive-e31"
259 // MTUNE-E31-MCPU-E76-NOT: "-target-feature" "+f"
260 // MTUNE-E31-MCPU-E76-SAME: "-target-feature" "+m"
261 // MTUNE-E31-MCPU-E76-SAME: "-target-feature" "+a"
262 // MTUNE-E31-MCPU-E76-SAME: "-target-feature" "+c"
263 // MTUNE-E31-MCPU-E76-SAME: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
264 // MTUNE-E31-MCPU-E76-SAME: "-tune-cpu" "sifive-e76"
265
266 // mcpu with default march include experimental extensions
267 // RUN: %clang -target riscv64 -### -c %s 2>&1 -menable-experimental-extensions -mcpu=sifive-x280 | FileCheck -check-prefix=MCPU-SIFIVE-X280 %s
268 // MCPU-SIFIVE-X280: "-nostdsysteminc" "-target-cpu" "sifive-x280"
269 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d"
270 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+c" "-target-feature" "+v"
271 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zicsr" "-target-feature" "+zifencei"
272 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zfh"
273 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zba" "-target-feature" "+zbb"
274 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvfh"
275 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl128b"
276 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl256b" "-target-feature" "+zvl32b"
277 // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl512b" "-target-feature" "+zvl64b"
278 // MCPU-SIFIVE-X280-SAME: "-target-abi" "lp64d"
279
280 // RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p450 | FileCheck -check-prefix=MCPU-SIFIVE-P450 %s
281 // MCPU-SIFIVE-P450: "-nostdsysteminc" "-target-cpu" "sifive-p450"
282 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+m"
283 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+a"
284 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+f"
285 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+d"
286 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+c"
287 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zic64b"
288 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicbom"
289 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicbop"
290 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicboz"
291 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+ziccamoa"
292 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+ziccif"
293 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicclsm"
294 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+ziccrse"
295 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zicsr"
296 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zifencei"
297 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihintntl"
298 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihintpause"
299 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zihpm"
300 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+za64rs"
301 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zfhmin"
302 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zba"
303 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbb"
304 // MCPU-SIFIVE-P450-SAME: "-target-feature" "+zbs"
305 // MCPU-SIFIVE-P450-SAME: "-target-abi" "lp64d"
306
307 // RUN: %clang -target riscv64 -### -c %s 2>&1 -mcpu=sifive-p670 | FileCheck -check-prefix=MCPU-SIFIVE-P670 %s
308 // MCPU-SIFIVE-P670: "-target-cpu" "sifive-p670"
309 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+m"
310 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+a"
311 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+f"
312 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+d"
313 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+c"
314 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+v"
315 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zic64b"
316 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicbom"
317 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicbop"
318 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicboz"
319 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccamoa"
320 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccif"
321 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicclsm"
322 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+ziccrse"
323 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zicsr"
324 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zifencei"
325 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihintntl"
326 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihintpause"
327 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zihpm"
328 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+za64rs"
329 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zfhmin"
330 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zba"
331 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zbb"
332 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zbs"
333 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvbb"
334 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvbc"
335 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve32f"
336 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve32x"
337 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64d"
338 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64f"
339 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zve64x"
340 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkg"
341 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkn"
342 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvknc"
343 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkned"
344 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkng"
345 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvknhb"
346 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvks"
347 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksc"
348 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksed"
349 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksg"
350 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvksh"
351 // MCPU-SIFIVE-P670-SAME: "-target-feature" "+zvkt"
352 // MCPU-SIFIVE-P670-SAME: "-target-abi" "lp64d"
353
354 // Check failed cases
355
356 // RUN: not %clang --target=riscv32 -### -c %s 2>&1 -mcpu=generic-rv321 | FileCheck -check-prefix=FAIL-MCPU-NAME %s
357 // FAIL-MCPU-NAME: error: unsupported argument 'generic-rv321' to option '-mcpu='
358
359 // RUN: not %clang --target=riscv32 -### -c %s 2>&1 -mcpu=generic-rv32 -march=rv64i | FileCheck -check-prefix=MISMATCH-ARCH %s
360 // MISMATCH-ARCH: cpu 'generic-rv32' does not support rv64
361
362 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=syntacore-scr3-rv32 | FileCheck -check-prefix=MCPU-SYNTACORE-SCR3-RV32 %s
363 // MCPU-SYNTACORE-SCR3-RV32: "-target-cpu" "syntacore-scr3-rv32"
364 // MCPU-SYNTACORE-SCR3-RV32-SAME: "-target-feature" "+m"
365 // MCPU-SYNTACORE-SCR3-RV32-SAME: "-target-feature" "+c"
366 // MCPU-SYNTACORE-SCR3-RV32-SAME: "-target-feature" "+zicsr"
367 // MCPU-SYNTACORE-SCR3-RV32-SAME: "-target-feature" "+zifencei"
368 // MCPU-SYNTACORE-SCR3-RV32-SAME: "-target-abi" "ilp32"
369
370 // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=syntacore-scr3-rv32 | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR3-RV32 %s
371 // MTUNE-SYNTACORE-SCR3-RV32: "-tune-cpu" "syntacore-scr3-rv32"
372
373 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=syntacore-scr3-rv64 | FileCheck -check-prefix=MCPU-SYNTACORE-SCR3-RV64 %s
374 // MCPU-SYNTACORE-SCR3-RV64: "-target-cpu" "syntacore-scr3-rv64"
375 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-feature" "+m"
376 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-feature" "+a"
377 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-feature" "+c"
378 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-feature" "+zicsr"
379 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-feature" "+zifencei"
380 // MCPU-SYNTACORE-SCR3-RV64-SAME: "-target-abi" "lp64"
381
382 // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=syntacore-scr3-rv64 | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR3-RV64 %s
383 // MTUNE-SYNTACORE-SCR3-RV64: "-tune-cpu" "syntacore-scr3-rv64"