Skip to content

Commit 6c10014

Browse files
committed
[RISCV][Clang] add more tests for clang driver. (NFC)
Test experimental arch, Zfh, Zfmin and Zve arch. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D124611
1 parent 83914ee commit 6c10014

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

clang/test/Driver/riscv-arch.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,26 @@
412412
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFHMIN %s
413413
// RV32-ZFHMIN: "-target-feature" "+zfhmin"
414414

415+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbt -### %s \
416+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-NOFLAG %s
417+
// RV32-EXPERIMENTAL-NOFLAG: error: invalid arch name 'rv32izbt'
418+
// RV32-EXPERIMENTAL-NOFLAG: requires '-menable-experimental-extensions'
419+
420+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbt -menable-experimental-extensions -### %s \
421+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-NOVERS %s
422+
// RV32-EXPERIMENTAL-NOVERS: error: invalid arch name 'rv32izbt'
423+
// RV32-EXPERIMENTAL-NOVERS: experimental extension requires explicit version number
424+
425+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbt0p1 -menable-experimental-extensions -### %s \
426+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-BADVERS %s
427+
// RV32-EXPERIMENTAL-BADVERS: error: invalid arch name 'rv32izbt0p1'
428+
// RV32-EXPERIMENTAL-BADVERS: unsupported version number 0.1 for experimental extension
429+
// RV32-EXPERIMENTAL-BADVERS: 'zbt'(this compiler supports 0.93)
430+
431+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbt0p93 -menable-experimental-extensions -### %s \
432+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-EXPERIMENTAL-GOODVERS %s
433+
// RV32-EXPERIMENTAL-GOODVERS: "-target-feature" "+experimental-zbt"
434+
415435
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbb1p0 -### %s \
416436
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZBB %s
417437
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izbb -### %s \
@@ -494,3 +514,48 @@
494514
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izk1p0 -### %s \
495515
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZK %s
496516
// RV32-ZK: "-target-feature" "+zk"
517+
518+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izfh1p0 -### %s \
519+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-RV32-ZFH %s
520+
// CHECK-RV32-ZFH: "-target-feature" "+zfh"
521+
522+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izfhmin1p0 -### %s \
523+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-RV32-ZFHMIN %s
524+
// CHECK-RV32-ZFHMIN: "-target-feature" "+zfhmin"
525+
526+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izve32x0p1 -### %s -c 2>&1 | \
527+
// RUN: FileCheck -check-prefix=RV32-ZVE32X-BADVERS %s
528+
// RV32-ZVE32X-BADVERS: error: invalid arch name 'rv32izve32x0p1'
529+
// RV32-ZVE32X-BADVERS: unsupported version number 0.1 for extension 'zve32x'
530+
531+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izve32x -### %s -c 2>&1 | \
532+
// RUN: FileCheck -check-prefix=RV32-ZVE32X-GOODVERS %s
533+
// RV32-ZVE32X-GOODVERS: "-target-feature" "+zve32x"
534+
535+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izve32f -### %s -c 2>&1 | \
536+
// RUN: FileCheck -check-prefix=RV32-ZVE32F-REQUIRE-F %s
537+
// RV32-ZVE32F-REQUIRE-F: error: invalid arch name 'rv32izve32f', zve32f requires f or zfinx extension to also be specified
538+
539+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32ifzve32f -### %s -c 2>&1 | \
540+
// RUN: FileCheck -check-prefix=RV32-ZVE32F-GOOD %s
541+
// RV32-ZVE32F-GOOD: "-target-feature" "+zve32f"
542+
543+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izve64x -### %s -c 2>&1 | \
544+
// RUN: FileCheck -check-prefix=RV32-ZVE64X %s
545+
// RV32-ZVE64X: "-target-feature" "+zve64x"
546+
547+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32izve64f -### %s -c 2>&1 | \
548+
// RUN: FileCheck -check-prefix=RV32-ZVE64F-REQUIRE-F %s
549+
// RV32-ZVE64F-REQUIRE-F: error: invalid arch name 'rv32izve64f', zve32f requires f or zfinx extension to also be specified
550+
551+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32ifzve64f -### %s -c 2>&1 | \
552+
// RUN: FileCheck -check-prefix=RV32-ZVE64F-GOOD %s
553+
// RV32-ZVE64F-GOOD: "-target-feature" "+zve64f"
554+
555+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32ifzve64d -### %s -c 2>&1 | \
556+
// RUN: FileCheck -check-prefix=RV32-ZVE64D-REQUIRE-D %s
557+
// RV32-ZVE64D-REQUIRE-D: error: invalid arch name 'rv32ifzve64d', zve64d requires d or zdinx extension to also be specified
558+
559+
// RUN: %clang --target=riscv32-unknown-elf -march=rv32ifdzve64d -### %s -c 2>&1 | \
560+
// RUN: FileCheck -check-prefix=RV32-ZVE64D-GOOD %s
561+
// RV32-ZVE64D-GOOD: "-target-feature" "+zve64d"

0 commit comments

Comments
 (0)