[llvm-debuginfo-analyzer] (04/09) - Locations and ranges
authorCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>
Thu, 20 Oct 2022 10:29:57 +0000 (11:29 +0100)
committerCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>
Thu, 20 Oct 2022 12:48:52 +0000 (13:48 +0100)
The test case 'LocationCoverage' caused a failure in:

  https://lab.llvm.org/buildbot/#/builders/5/builds/28385
  https://lab.llvm.org/buildbot/#/builders/168/builds/9585
  SUMMARY: AddressSanitizer: 176 byte(s) leaked in 2 allocation(s).

The logical debug locations 'LocationThree' and 'LocationFour'
are not added to any logical scope.

The test case is checking the logical symbol coverage and
it does not use those 2 debug locations.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D136333

llvm/unittests/DebugInfo/LogicalView/LocationRangesTest.cpp

index 5210535..cc0c035 100644 (file)
@@ -349,8 +349,6 @@ class ReaderTestCoverage : public ReaderTest {
   // Locations.
   LVLocation *LocationOne = nullptr;
   LVLocation *LocationTwo = nullptr;
-  LVLocation *LocationThree = nullptr;
-  LVLocation *LocationFour = nullptr;
   LVLocation *LocationFive = nullptr;
   LVLocation *LocationSix = nullptr;
 
@@ -393,8 +391,6 @@ void ReaderTestCoverage::createElements() {
   // Create the logical locations.
   LocationOne = create<LVLocation>();
   LocationTwo = create<LVLocation>();
-  LocationThree = create<LVLocation>();
-  LocationFour = create<LVLocation>();
   LocationFive = create<LVLocation>();
   LocationSix = create<LVLocation>();
 }
@@ -480,14 +476,6 @@ void ReaderTestCoverage::initElements() {
   EXPECT_STREQ(LocationTwo->getIntervalInfo().c_str(),
                " Lines 200:600 [0x0000005200:0x0000006100]");
 
-  set(LocationThree, LineThree, LineFive, 0x5400, 0x5800);
-  EXPECT_STREQ(LocationThree->getIntervalInfo().c_str(),
-               " Lines 300:500 [0x0000005400:0x0000005800]");
-
-  set(LocationFour, LineFour, LineFour, 0x5600, 0x5700);
-  EXPECT_STREQ(LocationFour->getIntervalInfo().c_str(),
-               " Lines 400:400 [0x0000005600:0x0000005700]");
-
   set(LocationFive, LineFive, LineFive, 0x5800, 0x5900);
   EXPECT_STREQ(LocationFive->getIntervalInfo().c_str(),
                " Lines 500:500 [0x0000005800:0x0000005900]");