Desc.str().c_str(), Name.str().c_str());
}
+ if (IgnoreUnknown && !isSupportedExtension(Ext))
+ continue;
+
ISAInfo->addExtension(Name, Major, Minor);
// Extension format is correct, keep parsing the extensions.
// TODO: Save Type, Name, Major, Minor to avoid parsing them later.
}
TEST(ParseArchString, IgnoresUnrecognizedExtensionNamesWithIgnoreUnknown) {
- for (StringRef Input : {"rv32ib"}) {
+ for (StringRef Input : {"rv32ib", "rv32i_zmadeup", "rv64i_smadeup",
+ "rv32i_sxmadeup", "rv64i_xmadeup"}) {
auto MaybeISAInfo = RISCVISAInfo::parseArchString(Input, true, false, true);
ASSERT_THAT_EXPECTED(MaybeISAInfo, Succeeded());
RISCVISAInfo &Info = **MaybeISAInfo;
EXPECT_EQ(Exts.size(), 1UL);
EXPECT_TRUE(Exts.at("i") == (RISCVExtensionInfo{"i", 2, 0}));
}
- // FIXME: These unrecognized extensions should be ignored just as in the
- // case above. The below captures the current (incorrect) behaviour.
- for (StringRef Input :
- {"rv32i_zmadeup", "rv64i_smadeup", "rv32i_sxmadeup", "rv64i_xmadeup"}) {
- auto MaybeISAInfo = RISCVISAInfo::parseArchString(Input, true, false, true);
- EXPECT_THAT_EXPECTED(MaybeISAInfo, Failed());
- }
}
TEST(ParseArchString, AcceptsVersionInLongOrShortForm) {