Skip to content

Commit f5fea45

Browse files
committed
[RISCV][NFC] Add tests to address invalid arch dependencies.
Improve test converage. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D121578
1 parent ae1623b commit f5fea45

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

clang/test/Driver/riscv-arch.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,31 @@
224224
// RV32-ORDER: error: invalid arch name 'rv32imcq',
225225
// RV32-ORDER: standard user-level extension not given in canonical order 'q'
226226

227+
// RUN: %clang -target riscv32-unknown-elf -march=rv64e -### %s \
228+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-EER %s
229+
// RV64-EER: error: invalid arch name 'rv64e',
230+
// RV64-EER: standard user-level extension 'e' requires 'rv32'
231+
232+
// RUN: %clang -target riscv32-unknown-elf -march=rv32id -### %s \
233+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-DER %s
234+
// RV32-DER: error: invalid arch name 'rv32id',
235+
// RV32-DER: d requires f extension to also be specified
236+
237+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izve32f -### %s \
238+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZVE32F-ER %s
239+
// RV32-ZVE32F-ER: error: invalid arch name 'rv32izve32f',
240+
// RV32-ZVE32F-ER: zve32f requires f or zfinx extension to also be specified
241+
242+
// RUN: %clang -target riscv32-unknown-elf -march=rv32ifzve64d -### %s \
243+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZVE64D-ER %s
244+
// RV32-ZVE64D-ER: error: invalid arch name 'rv32ifzve64d',
245+
// RV32-ZVE64D-ER: zve64d requires d or zdinx extension to also be specified
246+
247+
// RUN: %clang -target riscv32-unknown-elf -march=rv32izvl64b -### %s \
248+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZVL64B-ER %s
249+
// RV32-ZVL64B-ER: error: invalid arch name 'rv32izvl64b',
250+
// RV32-ZVL64B-ER: zvl*b requires v or zve* extension to also be specified
251+
227252
// RUN: %clang -target riscv32-unknown-elf -march=rv32imw -### %s \
228253
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-STD-INVAL %s
229254
// RV32-STD-INVAL: error: invalid arch name 'rv32imw',
@@ -376,6 +401,18 @@
376401
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64-TARGET %s
377402
// RV64-TARGET: "-triple" "riscv64-unknown-unknown-elf"
378403

404+
// RUN: %clang -target riscv32-unknown-elf -march=rv32ifzfh01p0 -### %s \
405+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFH %s
406+
// RUN: %clang -target riscv32-unknown-elf -march=rv32ifzfh -### %s \
407+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFH %s
408+
// RV32-ZFH: "-target-feature" "+zfh"
409+
410+
// RUN: %clang -target riscv32-unknown-elf -march=rv32ifzfhmin01p0 -### %s \
411+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFHMIN %s
412+
// RUN: %clang -target riscv32-unknown-elf -march=rv32ifzfhmin -### %s \
413+
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFHMIN %s
414+
// RV32-ZFHMIN: "-target-feature" "+zfhmin"
415+
379416
// RUN: %clang -target riscv32-unknown-elf -march=rv32izbb1p0 -### %s \
380417
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZBB %s
381418
// RUN: %clang -target riscv32-unknown-elf -march=rv32izbb -### %s \

0 commit comments

Comments
 (0)