Skip to content

Commit 902c41f

Browse files
committed
[scudo] Fix memtag tests.
A few memtag tests were using EXPECT_DEBUG_DEATH which executes the statement unless NDEBUG is set. This meant the statement would cause an abort, but the EXPECT_DEATH part was not done. Change these to simply EXPECT_DEATH, these tests already verify that SCUDO_DEBUG is set before checking for DEATH. Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D155538
1 parent 729ffb5 commit 902c41f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ TEST_F(MemtagDeathTest, AddFixedTag) {
8888
for (uptr Tag = 0; Tag < 0x10; ++Tag)
8989
EXPECT_EQ(Tag, extractTag(addFixedTag(Addr, Tag)));
9090
if (SCUDO_DEBUG) {
91-
EXPECT_DEBUG_DEATH(addFixedTag(Addr, 16), "");
92-
EXPECT_DEBUG_DEATH(addFixedTag(~Addr, 0), "");
91+
EXPECT_DEATH(addFixedTag(Addr, 16), "");
92+
EXPECT_DEATH(addFixedTag(~Addr, 0), "");
9393
}
9494
}
9595

@@ -131,8 +131,8 @@ TEST_F(MemtagDeathTest, SKIP_NO_DEBUG(LoadStoreTagUnaligned)) {
131131
for (uptr P = Addr; P < Addr + 4 * archMemoryTagGranuleSize(); ++P) {
132132
if (P % archMemoryTagGranuleSize() == 0)
133133
continue;
134-
EXPECT_DEBUG_DEATH(loadTag(P), "");
135-
EXPECT_DEBUG_DEATH(storeTag(P), "");
134+
EXPECT_DEATH(loadTag(P), "");
135+
EXPECT_DEATH(storeTag(P), "");
136136
}
137137
}
138138

@@ -153,7 +153,7 @@ TEST_F(MemtagDeathTest, SKIP_NO_DEBUG(StoreTagsUnaligned)) {
153153
uptr Tagged = addFixedTag(P, 5);
154154
if (Tagged % archMemoryTagGranuleSize() == 0)
155155
continue;
156-
EXPECT_DEBUG_DEATH(storeTags(Tagged, Tagged), "");
156+
EXPECT_DEATH(storeTags(Tagged, Tagged), "");
157157
}
158158
}
159159

0 commit comments

Comments
 (0)