Skip to content

Commit

Permalink
Make TargetParserTest.ARMExtensionFeatures not run out of memory on 3…
Browse files Browse the repository at this point in the history
…2-bit (PR42316)

The test still probably shouldn't run this loop 17 million times, but at
least now it won't run out of memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363780 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
zmodem committed Jun 19, 2019
1 parent 301f3b0 commit 1e28f6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unittests/Support/TargetParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,16 @@ TEST(TargetParserTest, ARMFPURestriction) {
}

TEST(TargetParserTest, ARMExtensionFeatures) {
std::vector<StringRef> Features;
unsigned Extensions = ARM::AEK_CRC | ARM::AEK_CRYPTO | ARM::AEK_DSP |
ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_MP |
ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_RAS | ARM::AEK_FP16 |
ARM::AEK_FP16FML | ARM::AEK_FP_DP;

for (unsigned i = 0; i <= Extensions; i++)
for (unsigned i = 0; i <= Extensions; i++) {
std::vector<StringRef> Features;
EXPECT_TRUE(i == 0 ? !ARM::getExtensionFeatures(i, Features)
: ARM::getExtensionFeatures(i, Features));
}
}

TEST(TargetParserTest, ARMFPUFeatures) {
Expand Down

0 comments on commit 1e28f6e

Please sign in to comment.