Follow up of rL363913. NFC.

Minor reshuffle in AArch64 targetparser unittest, solving a potential problem
with querying iterators too early.

llvm-svn: 364168
This commit is contained in:
Sjoerd Meijer 2019-06-24 08:44:29 +00:00
parent 8c1b73591f
commit a94c18fc20
1 changed files with 8 additions and 6 deletions

View File

@ -1053,16 +1053,18 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
std::vector<StringRef> Features;
unsigned ExtVal = 0;
for (auto E : Extensions)
ExtVal |= E;
AArch64::getExtensionFeatures(ExtVal, Features);
auto B = std::begin(Features);
auto E = std::end(Features);
for (auto Ext : Extensions)
ExtVal |= Ext;
EXPECT_FALSE(AArch64::getExtensionFeatures(AArch64::AEK_INVALID, Features));
EXPECT_TRUE(!Features.size());
AArch64::getExtensionFeatures(ExtVal, Features);
EXPECT_TRUE(Extensions.size() == Features.size());
auto B = std::begin(Features);
auto E = std::end(Features);
EXPECT_TRUE(std::find(B, E, "+crc") != E);
EXPECT_TRUE(std::find(B, E, "+crypto") != E);
EXPECT_TRUE(std::find(B, E, "+fp-armv8") != E);