Skip to content

Commit f61ed8f

Browse files
committed
update test
1 parent 17d24ca commit f61ed8f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ TEST_F(DebugLineBasicFixture, LookupAddressRangeWithStmtSequenceOffset) {
21542154
/// With the old exclusive HighPC logic, lookups at the last row's address would
21552155
/// fail. With the new inclusive HighPC logic, lookups at the HighPC address
21562156
/// should succeed.
2157-
TEST_F(DebugLineBasicFixture, HighPCInclusiveLookup) {
2157+
TEST_F(DebugLineBasicFixture, LookupLastRow) {
21582158
if (!setupGenerator())
21592159
GTEST_SKIP();
21602160

@@ -2189,7 +2189,7 @@ TEST_F(DebugLineBasicFixture, HighPCInclusiveLookup) {
21892189
ASSERT_EQ(Table->Sequences.size(), 1u);
21902190
const auto &Seq = Table->Sequences[0];
21912191
EXPECT_EQ(Seq.LowPC, 0x1000U);
2192-
EXPECT_EQ(Seq.HighPC, 0x1011U);
2192+
EXPECT_EQ(Seq.HighPC, 0x1010U);
21932193

21942194
auto LastRow = Table->Rows.back();
21952195

@@ -2199,8 +2199,7 @@ TEST_F(DebugLineBasicFixture, HighPCInclusiveLookup) {
21992199
{
22002200
uint32_t RowIndex = Table->lookupAddress(
22012201
{LastRow.Address.Address, object::SectionedAddress::UndefSection});
2202-
// EXPECT_NE(RowIndex, Table->UnknownRowIndex) << "Lookup at HighPC found no
2203-
// row";
2202+
// Both last and the second to the last row have the same PC, so the second to the last should pop up first.
22042203
EXPECT_EQ(RowIndex, Table->Rows.size() - 2)
22052204
<< "Lookup at HighPC should find the second to the last row";
22062205
}
@@ -2209,7 +2208,7 @@ TEST_F(DebugLineBasicFixture, HighPCInclusiveLookup) {
22092208
/// Test that a sequence with only one row works correctly with inclusive
22102209
/// HighPC. This is an important edge case where LowPC == HighPC, and the
22112210
/// inclusive HighPC logic should still allow lookups at that single address.
2212-
TEST_F(DebugLineBasicFixture, SingleInstSequenceInclusiveHighPC) {
2211+
TEST_F(DebugLineBasicFixture, SingleInstSeq) {
22132212
if (!setupGenerator())
22142213
GTEST_SKIP();
22152214

@@ -2236,7 +2235,7 @@ TEST_F(DebugLineBasicFixture, SingleInstSequenceInclusiveHighPC) {
22362235
ASSERT_EQ(Table->Sequences.size(), 1u);
22372236
const auto &Seq = Table->Sequences[0];
22382237
EXPECT_EQ(Seq.LowPC, 0x3000U);
2239-
EXPECT_EQ(Seq.HighPC, 0x3001U);
2238+
EXPECT_EQ(Seq.HighPC, 0x3000U);
22402239

22412240
// Verify we have exactly one row (plus the end_sequence row)
22422241
EXPECT_EQ(Table->Rows.size(), 2u);
@@ -2251,8 +2250,6 @@ TEST_F(DebugLineBasicFixture, SingleInstSequenceInclusiveHighPC) {
22512250
{
22522251
uint32_t RowIndex = Table->lookupAddress(
22532252
{LastRow.Address.Address, object::SectionedAddress::UndefSection});
2254-
// EXPECT_NE(RowIndex, Table->UnknownRowIndex) << "Lookup at HighPC found no
2255-
// row";
22562253
EXPECT_EQ(RowIndex, Table->Rows.size() - 2)
22572254
<< "Lookup at HighPC should find the last row";
22582255
}

0 commit comments

Comments
 (0)