llvm.org GIT mirror llvm / cc4f834
[test] Fix TargetParserTest runtime. r363780 fixes extreme memory growth by using a new std::vector every loop iteration, but causes runtime to go up (and occasionally timeout in certain situations) because of constructor cost every loop iteration. Fix this by moving the constructor back out, but clearing contents in the loop. Also apply this to the AArch64 features test case, which seems to use the same pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363851 91177308-0d34-0410-b5e6-96231b3b80d8 Jordan Rupprecht a month ago
1 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
568568 }
569569
570570 TEST(TargetParserTest, ARMExtensionFeatures) {
571 std::vector Features;
571572 unsigned Extensions = ARM::AEK_CRC | ARM::AEK_CRYPTO | ARM::AEK_DSP |
572573 ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_MP |
573574 ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_RAS | ARM::AEK_FP16 |
574575 ARM::AEK_FP16FML | ARM::AEK_FP_DP;
575576
576577 for (unsigned i = 0; i <= Extensions; i++) {
577 std::vector Features;
578 Features.clear();
578579 EXPECT_TRUE(i == 0 ? !ARM::getExtensionFeatures(i, Features)
579580 : ARM::getExtensionFeatures(i, Features));
580581 }
10271028 AArch64::AEK_SVE2 | AArch64::AEK_DOTPROD |
10281029 AArch64::AEK_RCPC | AArch64::AEK_FP16FML;
10291030
1030 for (unsigned i = 0; i <= Extensions; i++)
1031 for (unsigned i = 0; i <= Extensions; i++) {
1032 Features.clear();
10311033 EXPECT_TRUE(i == 0 ? !AArch64::getExtensionFeatures(i, Features)
10321034 : AArch64::getExtensionFeatures(i, Features));
1035 }
10331036 }
10341037
10351038 TEST(TargetParserTest, AArch64ArchFeatures) {