[llvm] r260198 - Further reduce test overhead

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 21:36:58 PST 2016


Author: davidxl
Date: Mon Feb  8 23:36:57 2016
New Revision: 260198

URL: http://llvm.org/viewvc/llvm-project?rev=260198&view=rev
Log:
Further reduce test overhead

Modified:
    llvm/trunk/unittests/ProfileData/InstrProfTest.cpp

Modified: llvm/trunk/unittests/ProfileData/InstrProfTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ProfileData/InstrProfTest.cpp?rev=260198&r1=260197&r2=260198&view=diff
==============================================================================
--- llvm/trunk/unittests/ProfileData/InstrProfTest.cpp (original)
+++ llvm/trunk/unittests/ProfileData/InstrProfTest.cpp Mon Feb  8 23:36:57 2016
@@ -811,7 +811,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_p
 TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) {
   std::vector<std::string> FuncNames1;
   std::vector<std::string> 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_p
     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_p
       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];




More information about the llvm-commits mailing list