[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
https://github.com/topperc closed https://github.com/llvm/llvm-project/pull/91532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/91532 >From 0f5fcf5035d66fd4c1d1e97525e9266d8460b297 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 8 May 2024 13:40:31 -0700 Subject: [PATCH] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. Allow double underscores and trailing underscores. gcc and binutils allow extra underscores without error. --- clang/test/Driver/riscv-arch.c | 5 - llvm/lib/TargetParser/RISCVISAInfo.cpp | 16 +++- llvm/unittests/TargetParser/RISCVISAInfoTest.cpp | 15 +-- 3 files changed, 4 insertions(+), 32 deletions(-) diff --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c index ddf617bbb6237..418d8e91595de 100644 --- a/clang/test/Driver/riscv-arch.c +++ b/clang/test/Driver/riscv-arch.c @@ -308,11 +308,6 @@ // RV32-SMINOR0: error: invalid arch name 'rv32ist2p0', // RV32-SMINOR0: unsupported standard supervisor-level extension 'st' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_ -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-XSEP %s -// RV32-XSEP: error: invalid arch name 'rv32ixabc_', -// RV32-XSEP: extension name missing after separator '_' - // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_a -### %s \ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-PREFIX %s // RV32-PREFIX: error: invalid arch name 'rv32ixabc_a', diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp index c553e330a878b..14b757d04ce37 100644 --- a/llvm/lib/TargetParser/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -452,7 +452,7 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { // and separated by _. Split by _ and then extract the name and version // information for each extension. SmallVector Split; - Arch.split(Split, '_'); + Arch.split(Split, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (StringRef Ext : Split) { StringRef Prefix, MinorVersionStr; std::tie(Prefix, MinorVersionStr) = Ext.rsplit('p'); @@ -651,10 +651,6 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, break; } - if (Arch.back() == '_') -return createStringError(errc::invalid_argument, - "extension name missing after separator '_'"); - // Skip baseline. StringRef Exts = Arch.drop_front(1); @@ -697,16 +693,10 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, Exts.consume_front("_"); SmallVector SplitExts; - // Only split if the string is not empty. Otherwise the split will push an - // empty string into the vector. - if (!Exts.empty()) -Exts.split(SplitExts, '_'); + Exts.split(SplitExts, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (auto Ext : SplitExts) { -if (Ext.empty()) - return createStringError(errc::invalid_argument, - "extension name missing after separator '_'"); - +assert(!Ext.empty()); do { if (RISCVISAUtils::AllStdExts.contains(Ext.front())) { if (auto E = processSingleLetterExtension( diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index f9e386a85fea8..dc2a8b44cf15d 100644 --- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp +++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp @@ -38,8 +38,7 @@ TEST(ParseNormalizedArchString, RejectsInvalidBaseISA) { } TEST(ParseNormalizedArchString, RejectsMalformedInputs) { - for (StringRef Input : - {"rv64i2p0_", "rv32i2p0__a2p0", "rv64e2p", "rv32i", "rv64ip1"}) { + for (StringRef Input : {"rv64e2p", "rv32i", "rv64ip1"}) { EXPECT_EQ( toString(RISCVISAInfo::parseNormalizedArchString(Input).takeError()), "extension lacks version in expected format"); @@ -518,18 +517,6 @@ TEST(ParseArchString, "unsupported standard user-level extension 'zba1p0m'"); } -TEST(ParseArchString, RejectsDoubleOrTrailingUnderscore) { - EXPECT_EQ( - toString(RISCVISAInfo::parseArchString("rv64i__m", true).takeError()), - "extension name missing after separator '_'"); - - for (StringRef Input : - {"rv32ezicsr__zifencei", "rv32i_", "rv32izicsr_", "rv64im_"}) { -EXPECT_EQ(toString(RISCVISAInfo::parseArchString(Input, true).takeError()), - "extension name missing after separator '_'"); - } -} - TEST(ParseArchString, RejectsDuplicateExtensionNames) { EXPECT_EQ(toString(RISCVISAInfo::parseArchString("rv64ii", true).takeError()), "invalid standard user-level extension 'i'"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
topperc wrote: > This one seems lazy, avoiding trailing or duplicate underscores is easy. Yeah I don't really expect anyone to use it. It seemed like an unnecessary complication in our parsing code. I was considering getting rid of split call before the loop and make the loop work directly on the raw string. Not having to care about extra underscores makes that easier. https://github.com/llvm/llvm-project/pull/91532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/91532 >From 6bccebc9415034680426921fcc84d404ff32245d Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 8 May 2024 13:40:31 -0700 Subject: [PATCH 1/2] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. Allow double underscores and trailing underscores. gcc and binutils allow extra underscores without error. --- clang/test/Driver/riscv-arch.c| 5 llvm/lib/TargetParser/RISCVISAInfo.cpp| 29 ++- .../TargetParser/RISCVISAInfoTest.cpp | 14 + 3 files changed, 4 insertions(+), 44 deletions(-) diff --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c index ddf617bbb6237..418d8e91595de 100644 --- a/clang/test/Driver/riscv-arch.c +++ b/clang/test/Driver/riscv-arch.c @@ -308,11 +308,6 @@ // RV32-SMINOR0: error: invalid arch name 'rv32ist2p0', // RV32-SMINOR0: unsupported standard supervisor-level extension 'st' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_ -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-XSEP %s -// RV32-XSEP: error: invalid arch name 'rv32ixabc_', -// RV32-XSEP: extension name missing after separator '_' - // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_a -### %s \ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-PREFIX %s // RV32-PREFIX: error: invalid arch name 'rv32ixabc_a', diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp index 96590745b2ebc..dda2eeb515666 100644 --- a/llvm/lib/TargetParser/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -452,7 +452,7 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { // and separated by _. Split by _ and then extract the name and version // information for each extension. SmallVector Split; - Arch.split(Split, '_'); + Arch.split(Split, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (StringRef Ext : Split) { StringRef Prefix, MinorVersionStr; std::tie(Prefix, MinorVersionStr) = Ext.rsplit('p'); @@ -500,24 +500,6 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { return std::move(ISAInfo); } -static Error splitExtsByUnderscore(StringRef Exts, - std::vector &SplitExts) { - SmallVector Split; - if (Exts.empty()) -return Error::success(); - - Exts.split(Split, "_"); - - for (auto Ext : Split) { -if (Ext.empty()) - return createStringError(errc::invalid_argument, - "extension name missing after separator '_'"); - -SplitExts.push_back(Ext.str()); - } - return Error::success(); -} - static Error processMultiLetterExtension( StringRef RawExt, MapVector SplitExts; - if (auto E = splitExtsByUnderscore(Exts, SplitExts)) -return std::move(E); + SmallVector SplitExts; + Exts.split(SplitExts, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (auto &Ext : SplitExts) { StringRef CurrExt = Ext; diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index f9e386a85fea8..95a03b2a90ec6 100644 --- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp +++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp @@ -39,7 +39,7 @@ TEST(ParseNormalizedArchString, RejectsInvalidBaseISA) { TEST(ParseNormalizedArchString, RejectsMalformedInputs) { for (StringRef Input : - {"rv64i2p0_", "rv32i2p0__a2p0", "rv64e2p", "rv32i", "rv64ip1"}) { + {"rv64e2p", "rv32i", "rv64ip1"}) { EXPECT_EQ( toString(RISCVISAInfo::parseNormalizedArchString(Input).takeError()), "extension lacks version in expected format"); @@ -518,18 +518,6 @@ TEST(ParseArchString, "unsupported standard user-level extension 'zba1p0m'"); } -TEST(ParseArchString, RejectsDoubleOrTrailingUnderscore) { - EXPECT_EQ( - toString(RISCVISAInfo::parseArchString("rv64i__m", true).takeError()), - "extension name missing after separator '_'"); - - for (StringRef Input : - {"rv32ezicsr__zifencei", "rv32i_", "rv32izicsr_", "rv64im_"}) { -EXPECT_EQ(toString(RISCVISAInfo::parseArchString(Input, true).takeError()), - "extension name missing after separator '_'"); - } -} - TEST(ParseArchString, RejectsDuplicateExtensionNames) { EXPECT_EQ(toString(RISCVISAInfo::parseArchString("rv64ii", true).takeError()), "invalid standard user-level extension 'i'"); >From 25a67862c7d032ef57049642d0d30fd170e5d7f3 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 8 May 2024 14:06:52 -0700 Subject: [PATCH 2/2] fixup! clang-format --- llvm/unittests/TargetParser/RISCVISAInfoTest.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index 95a03b2a90ec6..dc2a8b44cf15d 100644 --- a/llvm/unittests/Targ
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
jrtc27 wrote: This one seems lazy, avoiding trailing or duplicate underscores is easy. https://github.com/llvm/llvm-project/pull/91532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff e3938f4d71493673033f6190454e7e19d5411ea7 6bccebc9415034680426921fcc84d404ff32245d -- clang/test/Driver/riscv-arch.c llvm/lib/TargetParser/RISCVISAInfo.cpp llvm/unittests/TargetParser/RISCVISAInfoTest.cpp `` View the diff from clang-format here. ``diff diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index 95a03b2a90..dc2a8b44cf 100644 --- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp +++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp @@ -38,8 +38,7 @@ TEST(ParseNormalizedArchString, RejectsInvalidBaseISA) { } TEST(ParseNormalizedArchString, RejectsMalformedInputs) { - for (StringRef Input : - {"rv64e2p", "rv32i", "rv64ip1"}) { + for (StringRef Input : {"rv64e2p", "rv32i", "rv64ip1"}) { EXPECT_EQ( toString(RISCVISAInfo::parseNormalizedArchString(Input).takeError()), "extension lacks version in expected format"); `` https://github.com/llvm/llvm-project/pull/91532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v @llvm/pr-subscribers-clang-driver Author: Craig Topper (topperc) Changes Allow double underscores and trailing underscores. gcc and binutils allow extra underscores without error. --- Full diff: https://github.com/llvm/llvm-project/pull/91532.diff 3 Files Affected: - (modified) clang/test/Driver/riscv-arch.c (-5) - (modified) llvm/lib/TargetParser/RISCVISAInfo.cpp (+3-26) - (modified) llvm/unittests/TargetParser/RISCVISAInfoTest.cpp (+1-13) ``diff diff --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c index ddf617bbb6237..418d8e91595de 100644 --- a/clang/test/Driver/riscv-arch.c +++ b/clang/test/Driver/riscv-arch.c @@ -308,11 +308,6 @@ // RV32-SMINOR0: error: invalid arch name 'rv32ist2p0', // RV32-SMINOR0: unsupported standard supervisor-level extension 'st' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_ -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-XSEP %s -// RV32-XSEP: error: invalid arch name 'rv32ixabc_', -// RV32-XSEP: extension name missing after separator '_' - // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_a -### %s \ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-PREFIX %s // RV32-PREFIX: error: invalid arch name 'rv32ixabc_a', diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp index 96590745b2ebc..dda2eeb515666 100644 --- a/llvm/lib/TargetParser/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -452,7 +452,7 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { // and separated by _. Split by _ and then extract the name and version // information for each extension. SmallVector Split; - Arch.split(Split, '_'); + Arch.split(Split, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (StringRef Ext : Split) { StringRef Prefix, MinorVersionStr; std::tie(Prefix, MinorVersionStr) = Ext.rsplit('p'); @@ -500,24 +500,6 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { return std::move(ISAInfo); } -static Error splitExtsByUnderscore(StringRef Exts, - std::vector &SplitExts) { - SmallVector Split; - if (Exts.empty()) -return Error::success(); - - Exts.split(Split, "_"); - - for (auto Ext : Split) { -if (Ext.empty()) - return createStringError(errc::invalid_argument, - "extension name missing after separator '_'"); - -SplitExts.push_back(Ext.str()); - } - return Error::success(); -} - static Error processMultiLetterExtension( StringRef RawExt, MapVector SplitExts; - if (auto E = splitExtsByUnderscore(Exts, SplitExts)) -return std::move(E); + SmallVector SplitExts; + Exts.split(SplitExts, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (auto &Ext : SplitExts) { StringRef CurrExt = Ext; diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index f9e386a85fea8..95a03b2a90ec6 100644 --- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp +++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp @@ -39,7 +39,7 @@ TEST(ParseNormalizedArchString, RejectsInvalidBaseISA) { TEST(ParseNormalizedArchString, RejectsMalformedInputs) { for (StringRef Input : - {"rv64i2p0_", "rv32i2p0__a2p0", "rv64e2p", "rv32i", "rv64ip1"}) { + {"rv64e2p", "rv32i", "rv64ip1"}) { EXPECT_EQ( toString(RISCVISAInfo::parseNormalizedArchString(Input).takeError()), "extension lacks version in expected format"); @@ -518,18 +518,6 @@ TEST(ParseArchString, "unsupported standard user-level extension 'zba1p0m'"); } -TEST(ParseArchString, RejectsDoubleOrTrailingUnderscore) { - EXPECT_EQ( - toString(RISCVISAInfo::parseArchString("rv64i__m", true).takeError()), - "extension name missing after separator '_'"); - - for (StringRef Input : - {"rv32ezicsr__zifencei", "rv32i_", "rv32izicsr_", "rv64im_"}) { -EXPECT_EQ(toString(RISCVISAInfo::parseArchString(Input, true).takeError()), - "extension name missing after separator '_'"); - } -} - TEST(ParseArchString, RejectsDuplicateExtensionNames) { EXPECT_EQ(toString(RISCVISAInfo::parseArchString("rv64ii", true).takeError()), "invalid standard user-level extension 'i'"); `` https://github.com/llvm/llvm-project/pull/91532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [llvm] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. (PR #91532)
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/91532 Allow double underscores and trailing underscores. gcc and binutils allow extra underscores without error. >From 6bccebc9415034680426921fcc84d404ff32245d Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 8 May 2024 13:40:31 -0700 Subject: [PATCH] [RISCV] Allow extra underscores in parseNormalizedArchString and parseArchString. Allow double underscores and trailing underscores. gcc and binutils allow extra underscores without error. --- clang/test/Driver/riscv-arch.c| 5 llvm/lib/TargetParser/RISCVISAInfo.cpp| 29 ++- .../TargetParser/RISCVISAInfoTest.cpp | 14 + 3 files changed, 4 insertions(+), 44 deletions(-) diff --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c index ddf617bbb6237..418d8e91595de 100644 --- a/clang/test/Driver/riscv-arch.c +++ b/clang/test/Driver/riscv-arch.c @@ -308,11 +308,6 @@ // RV32-SMINOR0: error: invalid arch name 'rv32ist2p0', // RV32-SMINOR0: unsupported standard supervisor-level extension 'st' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_ -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-XSEP %s -// RV32-XSEP: error: invalid arch name 'rv32ixabc_', -// RV32-XSEP: extension name missing after separator '_' - // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_a -### %s \ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-PREFIX %s // RV32-PREFIX: error: invalid arch name 'rv32ixabc_a', diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp index 96590745b2ebc..dda2eeb515666 100644 --- a/llvm/lib/TargetParser/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -452,7 +452,7 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { // and separated by _. Split by _ and then extract the name and version // information for each extension. SmallVector Split; - Arch.split(Split, '_'); + Arch.split(Split, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (StringRef Ext : Split) { StringRef Prefix, MinorVersionStr; std::tie(Prefix, MinorVersionStr) = Ext.rsplit('p'); @@ -500,24 +500,6 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { return std::move(ISAInfo); } -static Error splitExtsByUnderscore(StringRef Exts, - std::vector &SplitExts) { - SmallVector Split; - if (Exts.empty()) -return Error::success(); - - Exts.split(Split, "_"); - - for (auto Ext : Split) { -if (Ext.empty()) - return createStringError(errc::invalid_argument, - "extension name missing after separator '_'"); - -SplitExts.push_back(Ext.str()); - } - return Error::success(); -} - static Error processMultiLetterExtension( StringRef RawExt, MapVector SplitExts; - if (auto E = splitExtsByUnderscore(Exts, SplitExts)) -return std::move(E); + SmallVector SplitExts; + Exts.split(SplitExts, '_', /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (auto &Ext : SplitExts) { StringRef CurrExt = Ext; diff --git a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp index f9e386a85fea8..95a03b2a90ec6 100644 --- a/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp +++ b/llvm/unittests/TargetParser/RISCVISAInfoTest.cpp @@ -39,7 +39,7 @@ TEST(ParseNormalizedArchString, RejectsInvalidBaseISA) { TEST(ParseNormalizedArchString, RejectsMalformedInputs) { for (StringRef Input : - {"rv64i2p0_", "rv32i2p0__a2p0", "rv64e2p", "rv32i", "rv64ip1"}) { + {"rv64e2p", "rv32i", "rv64ip1"}) { EXPECT_EQ( toString(RISCVISAInfo::parseNormalizedArchString(Input).takeError()), "extension lacks version in expected format"); @@ -518,18 +518,6 @@ TEST(ParseArchString, "unsupported standard user-level extension 'zba1p0m'"); } -TEST(ParseArchString, RejectsDoubleOrTrailingUnderscore) { - EXPECT_EQ( - toString(RISCVISAInfo::parseArchString("rv64i__m", true).takeError()), - "extension name missing after separator '_'"); - - for (StringRef Input : - {"rv32ezicsr__zifencei", "rv32i_", "rv32izicsr_", "rv64im_"}) { -EXPECT_EQ(toString(RISCVISAInfo::parseArchString(Input, true).takeError()), - "extension name missing after separator '_'"); - } -} - TEST(ParseArchString, RejectsDuplicateExtensionNames) { EXPECT_EQ(toString(RISCVISAInfo::parseArchString("rv64ii", true).takeError()), "invalid standard user-level extension 'i'"); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits