std::optional<StringRef> Attr =
Attributes.getAttributeString(RISCVAttrs::ARCH);
if (Attr) {
- // Suppress version checking for experimental extensions to prevent erroring
- // when getting any unknown version of experimental extension.
- auto ParseResult = RISCVISAInfo::parseArchString(
- *Attr, /*EnableExperimentalExtension=*/true,
- /*ExperimentalExtensionVersionCheck=*/false,
- /*IgnoreUnknown=*/true);
+ auto ParseResult = RISCVISAInfo::parseNormalizedArchString(*Attr);
if (!ParseResult)
return ParseResult.takeError();
auto &ISAInfo = *ParseResult;
# RUN: rm -rf %t && split-file %s %t && cd %t
# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+m,+f,+d,+v noncanonicalized_arch.s -o noncanonicalized_arch.o
-# RUN: llvm-objdump -d noncanonicalized_arch.o | FileCheck %s --check-prefix=NONCANON
+# RUN: not llvm-objdump -d noncanonicalized_arch.o 2>&1 | FileCheck %s -DFILE=noncanonicalized_arch.o --check-prefix=NONCANON
# RUN: llvm-mc -filetype=obj -triple=riscv64 invalid_arch.s -o invalid_arch.o
-# RUN: not llvm-objdump -d invalid_arch.o 2>&1 | FileCheck %s --check-prefix=INVALID
+# RUN: not llvm-objdump -d invalid_arch.o 2>&1 | FileCheck %s -DFILE=invalid_arch.o --check-prefix=INVALID
# RUN: llvm-mc -filetype=obj -triple=riscv32 unknown_i_version.s -o unknown_i_version.o
# RUN: llvm-objdump -d unknown_i_version.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-I-VERSION
# RUN: llvm-objdump -d unknown_ext_name.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-EXT-NAME
#--- noncanonicalized_arch.s
-# NONCANON: vsetvli a3, a2, e8, m8, tu, mu
+# NONCANON: error: '[[FILE]]': arch string must begin with valid base ISA
+# NONCANON-NOT: {{.}}
vsetvli a3, a2, e8, m8, tu, mu
.section .riscv.attributes,"",@0x70000003
.Lend:
#--- invalid_arch.s
-# INVALID: string must begin with rv32{i,e,g} or rv64{i,e,g}
+# INVALID: error: '[[FILE]]': arch string must begin with valid base ISA
+# INVALID-NOT: {{.}}
nop
.section .riscv.attributes,"",@0x70000003
.Lend:
#--- unknown_ext_version.s
-# UNKNOWN-EXT-VERSION: <unknown>
+# UNKNOWN-EXT-VERSION: cbo.clean (t0)
cbo.clean (t0)
.section .riscv.attributes,"",@0x70000003