[llvm] b03a6db - [RISCV] Replace zihintntl with zicond in ISAInfo unittest

Piyou Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 04:41:30 PDT 2023


Author: Piyou Chen
Date: 2023-07-19T04:41:25-07:00
New Revision: b03a6db276dab884fc9cd500247221d6026c16ec

URL: https://github.com/llvm/llvm-project/commit/b03a6db276dab884fc9cd500247221d6026c16ec
DIFF: https://github.com/llvm/llvm-project/commit/b03a6db276dab884fc9cd500247221d6026c16ec.diff

LOG: [RISCV] Replace zihintntl with zicond in ISAInfo unittest

Some ISAInfo unittest base on experimental-zihintntl, but zihintntl will become none-experimental. This patch use another experimental extension zicond to replace zihintntl.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D155673

Added: 
    

Modified: 
    llvm/unittests/Support/RISCVISAInfoTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/RISCVISAInfoTest.cpp b/llvm/unittests/Support/RISCVISAInfoTest.cpp
index 3587147fdda99d..8e6e4b55d7c386 100644
--- a/llvm/unittests/Support/RISCVISAInfoTest.cpp
+++ b/llvm/unittests/Support/RISCVISAInfoTest.cpp
@@ -356,54 +356,54 @@ TEST(ParseArchString,
      RejectsExperimentalExtensionsIfNotEnableExperimentalExtension) {
   EXPECT_EQ(
       toString(
-          RISCVISAInfo::parseArchString("rv64izihintntl", false).takeError()),
+          RISCVISAInfo::parseArchString("rv64izicond", false).takeError()),
       "requires '-menable-experimental-extensions' for experimental extension "
-      "'zihintntl'");
+      "'zicond'");
 }
 
 TEST(ParseArchString,
      AcceptsExperimentalExtensionsIfEnableExperimentalExtension) {
-  // Note: If zihintntl becomes none-experimental, this test will need
+  // Note: If zicond becomes none-experimental, this test will need
   // updating (and unfortunately, it will still pass). The failure of
   // RejectsExperimentalExtensionsIfNotEnableExperimentalExtension will
   // hopefully serve as a reminder to update.
   auto MaybeISAInfo =
-      RISCVISAInfo::parseArchString("rv64izihintntl", true, false);
+      RISCVISAInfo::parseArchString("rv64izicond", true, false);
   ASSERT_THAT_EXPECTED(MaybeISAInfo, Succeeded());
   RISCVISAInfo::OrderedExtensionMap Exts = (*MaybeISAInfo)->getExtensions();
   EXPECT_EQ(Exts.size(), 2UL);
-  EXPECT_EQ(Exts.count("zihintntl"), 1U);
-  auto MaybeISAInfo2 = RISCVISAInfo::parseArchString("rv64izihintntl0p2", true);
+  EXPECT_EQ(Exts.count("zicond"), 1U);
+  auto MaybeISAInfo2 = RISCVISAInfo::parseArchString("rv64izicond1p0", true);
   ASSERT_THAT_EXPECTED(MaybeISAInfo2, Succeeded());
   RISCVISAInfo::OrderedExtensionMap Exts2 = (*MaybeISAInfo2)->getExtensions();
   EXPECT_EQ(Exts2.size(), 2UL);
-  EXPECT_EQ(Exts2.count("zihintntl"), 1U);
+  EXPECT_EQ(Exts2.count("zicond"), 1U);
 }
 
 TEST(ParseArchString,
      RequiresExplicitVersionNumberForExperimentalExtensionByDefault) {
   EXPECT_EQ(
       toString(
-          RISCVISAInfo::parseArchString("rv64izihintntl", true).takeError()),
-      "experimental extension requires explicit version number `zihintntl`");
+          RISCVISAInfo::parseArchString("rv64izicond", true).takeError()),
+      "experimental extension requires explicit version number `zicond`");
 }
 
 TEST(ParseArchString,
      AcceptsUnrecognizedVersionIfNotExperimentalExtensionVersionCheck) {
   auto MaybeISAInfo =
-      RISCVISAInfo::parseArchString("rv64izihintntl9p9", true, false);
+      RISCVISAInfo::parseArchString("rv64izicond9p9", true, false);
   ASSERT_THAT_EXPECTED(MaybeISAInfo, Succeeded());
   RISCVISAInfo::OrderedExtensionMap Exts = (*MaybeISAInfo)->getExtensions();
   EXPECT_EQ(Exts.size(), 2UL);
-  EXPECT_TRUE(Exts.at("zihintntl") == (RISCVExtensionInfo{9, 9}));
+  EXPECT_TRUE(Exts.at("zicond") == (RISCVExtensionInfo{9, 9}));
 }
 
 TEST(ParseArchString, RejectsUnrecognizedVersionForExperimentalExtension) {
   EXPECT_EQ(
       toString(
-          RISCVISAInfo::parseArchString("rv64izihintntl9p9", true).takeError()),
-      "unsupported version number 9.9 for experimental extension 'zihintntl' "
-      "(this compiler supports 0.2)");
+          RISCVISAInfo::parseArchString("rv64izicond9p9", true).takeError()),
+      "unsupported version number 9.9 for experimental extension 'zicond' "
+      "(this compiler supports 1.0)");
 }
 
 TEST(ParseArchString, RejectsExtensionVersionForG) {
@@ -478,16 +478,16 @@ TEST(ParseArchString, RejectsConflictingExtensions) {
 
 TEST(ToFeatureVector, IIsDroppedAndExperimentalExtensionsArePrefixed) {
   auto MaybeISAInfo1 =
-      RISCVISAInfo::parseArchString("rv64im_zihintntl", true, false);
+      RISCVISAInfo::parseArchString("rv64im_zicond", true, false);
   ASSERT_THAT_EXPECTED(MaybeISAInfo1, Succeeded());
   EXPECT_THAT((*MaybeISAInfo1)->toFeatureVector(),
-              ElementsAre("+m", "+experimental-zihintntl"));
+              ElementsAre("+m", "+experimental-zicond"));
 
   auto MaybeISAInfo2 = RISCVISAInfo::parseArchString(
-      "rv32e_zihintntl_xventanacondops", true, false);
+      "rv32e_zicond_xventanacondops", true, false);
   ASSERT_THAT_EXPECTED(MaybeISAInfo2, Succeeded());
   EXPECT_THAT((*MaybeISAInfo2)->toFeatureVector(),
-              ElementsAre("+e", "+experimental-zihintntl", "+xventanacondops"));
+              ElementsAre("+e", "+experimental-zicond", "+xventanacondops"));
 }
 
 TEST(ToFeatureVector, UnsupportedExtensionsAreDropped) {


        


More information about the llvm-commits mailing list