[llvm] r307596 - InstrProf: Fix unit test which accidentally used a duplicate name

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 14:44:43 PDT 2017


Author: vedantk
Date: Mon Jul 10 14:44:43 2017
New Revision: 307596

URL: http://llvm.org/viewvc/llvm-project?rev=307596&view=rev
Log:
InstrProf: Fix unit test which accidentally used a duplicate name

This unit test constructed some profile records incorrectly. One of the
records had a duplicate name: adding that record into the writer caused
an error unrelated to what needed to be tested.

Reported by David Blaikie!

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=307596&r1=307595&r2=307596&view=diff
==============================================================================
--- llvm/trunk/unittests/ProfileData/InstrProfTest.cpp (original)
+++ llvm/trunk/unittests/ProfileData/InstrProfTest.cpp Mon Jul 10 14:44:43 2017
@@ -996,10 +996,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_p
 TEST_F(SparseInstrProfTest, preserve_no_records) {
   Writer.addRecord({"foo", 0x1234, {0}}, Err);
   Writer.addRecord({"bar", 0x4321, {0, 0}}, Err);
-  // FIXME: I'm guessing this data should be different, but the original author
-  // should check/update this test so it doesn't produce errors.
-  Writer.addRecord({"bar", 0x4321, {0, 0, 0}},
-                   [](Error E) { consumeError(std::move(E)); });
+  Writer.addRecord({"baz", 0x4321, {0, 0, 0}}, Err);
 
   auto Profile = Writer.writeBuffer();
   readProfile(std::move(Profile));




More information about the llvm-commits mailing list