|
287 | 287 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=xiangshan-nanhu | FileCheck -check-prefix=MTUNE-XIANGSHAN-NANHU %s |
288 | 288 | // MTUNE-XIANGSHAN-NANHU: "-tune-cpu" "xiangshan-nanhu" |
289 | 289 |
|
290 | | -// Check mtune alias CPU has resolved to the right CPU according XLEN. |
| 290 | +// Check -mtune alias CPU has resolved to the right CPU according XLEN. |
291 | 291 | // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mtune=generic | FileCheck -check-prefix=MTUNE-GENERIC-32 %s |
292 | 292 | // MTUNE-GENERIC-32: "-tune-cpu" "generic" |
293 | 293 |
|
|
304 | 304 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=native | FileCheck -check-prefix=MTUNE-NATIVE %s |
305 | 305 | // MTUNE-NATIVE-NOT: "-tune-cpu" "native" |
306 | 306 |
|
307 | | -// mcpu with default march |
| 307 | +// -mcpu with default -march |
308 | 308 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e20 | FileCheck -check-prefix=MCPU-SIFIVE-E20 %s |
309 | 309 | // MCPU-SIFIVE-E20: "-nostdsysteminc" "-target-cpu" "sifive-e20" |
310 | 310 | // MCPU-SIFIVE-E20: "-target-feature" "+m" "-target-feature" "+c" |
311 | 311 | // MCPU-SIFIVE-E20: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
312 | 312 | // MCPU-SIFIVE-E20: "-target-abi" "ilp32" |
313 | 313 |
|
314 | | -// mcpu with default march |
| 314 | +// -mcpu with default -march |
315 | 315 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e21 | FileCheck -check-prefix=MCPU-SIFIVE-E21 %s |
316 | 316 | // MCPU-SIFIVE-E21: "-nostdsysteminc" "-target-cpu" "sifive-e21" |
317 | 317 | // MCPU-SIFIVE-E21: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+c" |
318 | 318 | // MCPU-SIFIVE-E21: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
319 | 319 | // MCPU-SIFIVE-E21: "-target-abi" "ilp32" |
320 | 320 |
|
321 | | -// mcpu with default march |
| 321 | +// -mcpu with default -march |
322 | 322 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e24 | FileCheck -check-prefix=MCPU-SIFIVE-E24 %s |
323 | 323 | // MCPU-SIFIVE-E24: "-nostdsysteminc" "-target-cpu" "sifive-e24" |
324 | 324 | // MCPU-SIFIVE-E24: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" |
325 | 325 | // MCPU-SIFIVE-E24: "-target-feature" "+c" |
326 | 326 | // MCPU-SIFIVE-E24: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
327 | 327 | // MCPU-SIFIVE-E24: "-target-abi" "ilp32f" |
328 | 328 |
|
329 | | -// mcpu with default march |
| 329 | +// -mcpu with default -march |
330 | 330 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e34 | FileCheck -check-prefix=MCPU-SIFIVE-E34 %s |
331 | 331 | // MCPU-SIFIVE-E34: "-nostdsysteminc" "-target-cpu" "sifive-e34" |
332 | 332 | // MCPU-SIFIVE-E34: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" |
333 | 333 | // MCPU-SIFIVE-E34: "-target-feature" "+c" |
334 | 334 | // MCPU-SIFIVE-E34: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
335 | 335 | // MCPU-SIFIVE-E34: "-target-abi" "ilp32f" |
336 | 336 |
|
337 | | -// mcpu with mabi option |
| 337 | +// -mcpu with -mabi option |
338 | 338 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s21 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-S21 %s |
339 | 339 | // MCPU-ABI-SIFIVE-S21: "-nostdsysteminc" "-target-cpu" "sifive-s21" |
340 | 340 | // MCPU-ABI-SIFIVE-S21: "-target-feature" "+m" "-target-feature" "+a" |
341 | 341 | // MCPU-ABI-SIFIVE-S21: "-target-feature" "+c" |
342 | 342 | // MCPU-ABI-SIFIVE-S21: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
343 | 343 | // MCPU-ABI-SIFIVE-S21: "-target-abi" "lp64" |
344 | 344 |
|
345 | | -// mcpu with mabi option |
| 345 | +// -mcpu with -mabi option |
346 | 346 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s51 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-S51 %s |
347 | 347 | // MCPU-ABI-SIFIVE-S51: "-nostdsysteminc" "-target-cpu" "sifive-s51" |
348 | 348 | // MCPU-ABI-SIFIVE-S51: "-target-feature" "+m" "-target-feature" "+a" |
349 | 349 | // MCPU-ABI-SIFIVE-S51: "-target-feature" "+c" |
350 | 350 | // MCPU-ABI-SIFIVE-S51: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
351 | 351 | // MCPU-ABI-SIFIVE-S51: "-target-abi" "lp64" |
352 | 352 |
|
353 | | -// mcpu with default march |
| 353 | +// -mcpu with default -march |
354 | 354 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s54 | FileCheck -check-prefix=MCPU-SIFIVE-S54 %s |
355 | 355 | // MCPU-SIFIVE-S54: "-nostdsysteminc" "-target-cpu" "sifive-s54" |
356 | 356 | // MCPU-SIFIVE-S54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
357 | 357 | // MCPU-SIFIVE-S54: "-target-feature" "+c" |
358 | 358 | // MCPU-SIFIVE-S54: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
359 | 359 | // MCPU-SIFIVE-S54: "-target-abi" "lp64d" |
360 | 360 |
|
361 | | -// mcpu with mabi option |
| 361 | +// -mcpu with -mabi option |
362 | 362 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-s76 | FileCheck -check-prefix=MCPU-SIFIVE-S76 %s |
363 | 363 | // MCPU-SIFIVE-S76: "-nostdsysteminc" "-target-cpu" "sifive-s76" |
364 | 364 | // MCPU-SIFIVE-S76: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
365 | 365 | // MCPU-SIFIVE-S76: "-target-feature" "+c" |
366 | 366 | // MCPU-SIFIVE-S76: "-target-feature" "+zicsr" "-target-feature" "+zifencei" "-target-feature" "+zihintpause" |
367 | 367 | // MCPU-SIFIVE-S76: "-target-abi" "lp64d" |
368 | 368 |
|
369 | | -// mcpu with default march |
| 369 | +// -mcpu with default -march |
370 | 370 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u54 | FileCheck -check-prefix=MCPU-SIFIVE-U54 %s |
371 | 371 | // MCPU-SIFIVE-U54: "-nostdsysteminc" "-target-cpu" "sifive-u54" |
372 | 372 | // MCPU-SIFIVE-U54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
373 | 373 | // MCPU-SIFIVE-U54: "-target-feature" "+c" |
374 | 374 | // MCPU-SIFIVE-U54: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
375 | 375 | // MCPU-SIFIVE-U54: "-target-abi" "lp64d" |
376 | 376 |
|
377 | | -// mcpu with mabi option |
| 377 | +// -mcpu with -mabi option |
378 | 378 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u54 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-U54 %s |
379 | 379 | // MCPU-ABI-SIFIVE-U54: "-nostdsysteminc" "-target-cpu" "sifive-u54" |
380 | 380 | // MCPU-ABI-SIFIVE-U54: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
381 | 381 | // MCPU-ABI-SIFIVE-U54: "-target-feature" "+c" |
382 | 382 | // MCPU-ABI-SIFIVE-U54: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
383 | 383 | // MCPU-ABI-SIFIVE-U54: "-target-abi" "lp64" |
384 | 384 |
|
385 | | -// mcpu with default march |
| 385 | +// -mcpu with default -march |
386 | 386 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-e76 | FileCheck -check-prefix=MCPU-SIFIVE-E76 %s |
387 | 387 | // MCPU-SIFIVE-E76: "-nostdsysteminc" "-target-cpu" "sifive-e76" |
388 | 388 | // MCPU-SIFIVE-E76: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" |
389 | 389 | // MCPU-SIFIVE-E76: "-target-feature" "+c" |
390 | 390 | // MCPU-SIFIVE-E76: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
391 | 391 | // MCPU-SIFIVE-E76: "-target-abi" "ilp32f" |
392 | 392 |
|
393 | | -// mcpu with mabi option |
| 393 | +// -mcpu with -mabi option |
394 | 394 | // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=sifive-u74 -mabi=lp64 | FileCheck -check-prefix=MCPU-ABI-SIFIVE-U74 %s |
395 | 395 | // MCPU-ABI-SIFIVE-U74: "-nostdsysteminc" "-target-cpu" "sifive-u74" |
396 | 396 | // MCPU-ABI-SIFIVE-U74: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
397 | 397 | // MCPU-ABI-SIFIVE-U74: "-target-feature" "+c" |
398 | 398 | // MCPU-ABI-SIFIVE-U74: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
399 | 399 | // MCPU-ABI-SIFIVE-U74: "-target-abi" "lp64" |
400 | 400 |
|
401 | | -// march overwrite mcpu's default march |
| 401 | +// -march overwrite -mcpu's default -march |
402 | 402 | // RUN: %clang --target=riscv32 -### -c %s 2>&1 -mcpu=sifive-e31 -march=rv32imc | FileCheck -check-prefix=MCPU-MARCH %s |
403 | 403 | // MCPU-MARCH: "-nostdsysteminc" "-target-cpu" "sifive-e31" "-target-feature" "+m" "-target-feature" "+c" |
404 | 404 | // MCPU-MARCH: "-target-abi" "ilp32" |
405 | 405 |
|
406 | | -// Check interaction between mcpu and mtune, mtune won't affect arch related |
407 | | -// target feature, but mcpu will. |
| 406 | +// Check interaction between -mcpu and mtune, -mtune won't affect arch related |
| 407 | +// target feature, but -mcpu will. |
408 | 408 | // |
409 | 409 | // In this case, sifive-e31 is rv32imac, sifive-e76 is rv32imafc, so F-extension |
410 | 410 | // should not enabled. |
|
418 | 418 | // MTUNE-E31-MCPU-E76-SAME: "-target-feature" "+zicsr" "-target-feature" "+zifencei" |
419 | 419 | // MTUNE-E31-MCPU-E76-SAME: "-tune-cpu" "sifive-e76" |
420 | 420 |
|
421 | | -// mcpu with default march include experimental extensions |
| 421 | +// -mcpu with default -march include experimental extensions |
422 | 422 | // RUN: %clang -target riscv64 -### -c %s 2>&1 -menable-experimental-extensions -mcpu=sifive-x280 | FileCheck -check-prefix=MCPU-SIFIVE-X280 %s |
423 | 423 | // MCPU-SIFIVE-X280: "-nostdsysteminc" "-target-cpu" "sifive-x280" |
424 | 424 | // MCPU-SIFIVE-X280-SAME: "-target-feature" "+m" "-target-feature" "+a" "-target-feature" "+f" "-target-feature" "+d" |
|
0 commit comments