From c2f25cc4cc25455f394d6bf10aa31866d2c3b490 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Tue, 9 Feb 2016 05:36:57 +0000 Subject: [PATCH] Further reduce test overhead llvm-svn: 260198 --- llvm/unittests/ProfileData/InstrProfTest.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index 13067f0..1c52642 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -811,7 +811,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) { TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) { std::vector FuncNames1; std::vector FuncNames2; - for (int I = 0; I < 128; I++) { + for (int I = 0; I < 3; I++) { std::string str; raw_string_ostream OS(str); OS << "func_" << I; @@ -838,8 +838,8 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) { collectPGOFuncNameStrings( FuncNames2, (DoCompression && zlib::isAvailable()), FuncNameStrings2); - for (int Padding = 0; Padding < 3; Padding++) { - // Join with paddings: + for (int Padding = 0; Padding < 2; Padding++) { + // Join with paddings : std::string FuncNameStrings = FuncNameStrings1; for (int P = 0; P < Padding; P++) { FuncNameStrings.push_back('\0'); @@ -856,11 +856,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) { ASSERT_EQ(StringRef("func_0"), R); R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames1[1])); ASSERT_EQ(StringRef("fooooooooooooooo_0"), R); - R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[100])); - ASSERT_EQ(StringRef("BAR_50"), R); - R = Symtab.getFuncName(IndexedInstrProf::ComputeHash(FuncNames2[101])); - ASSERT_EQ(StringRef("BlahblahBlahblahBar_50"), R); - for (int I = 0; I < 128; I++) { + for (int I = 0; I < 3; I++) { std::string N[4]; N[0] = FuncNames1[2 * I]; N[1] = FuncNames1[2 * I + 1]; -- 2.7.4