]> granicus.if.org Git - llvm/commitdiff
InstrProf: Fix unit test which accidentally used a duplicate name
authorVedant Kumar <vsk@apple.com>
Mon, 10 Jul 2017 21:44:43 +0000 (21:44 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 10 Jul 2017 21:44:43 +0000 (21:44 +0000)
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307596 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ProfileData/InstrProfTest.cpp

index 71795b01ba8b32a3ebec3807ad755c892c999599..79f880e475c62a46dfa2701e8167686f1fa8b7ee 100644 (file)
@@ -996,10 +996,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_compression_test) {
 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));