Skip to content

Commit 9259fbe

Browse files
committed
[libc] Remove LlvmLibcStackChkFail.Smash test
This test was problematic, and also unnecessary. It's not really a test of the libc functionality or ABI. That's already covered by the LlvmLibcStackChkFail.Death test. The Smash test was in fact just testing that the compiler produces the call in the expected situation. That's a compiler test, not a libc test. It's not really feasible to make a test like this both reliable and safe. Since it's not something libc needs to test, it's not worth trying.
1 parent fa10047 commit 9259fbe

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

libc/test/src/compiler/stack_chk_guard_test.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,9 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "hdr/signal_macros.h"
10-
#include "src/__support/macros/sanitizer.h"
1110
#include "src/compiler/__stack_chk_fail.h"
12-
#include "src/string/memset.h"
1311
#include "test/UnitTest/Test.h"
1412

1513
TEST(LlvmLibcStackChkFail, Death) {
1614
EXPECT_DEATH([] { __stack_chk_fail(); }, WITH_SIGNAL(SIGABRT));
1715
}
18-
19-
// Disable the test when asan is enabled so that it doesn't immediately fail
20-
// after the memset, but before the stack canary is re-checked.
21-
#ifndef LIBC_HAS_ADDRESS_SANITIZER
22-
TEST(LlvmLibcStackChkFail, Smash) {
23-
EXPECT_DEATH(
24-
[] {
25-
int arr[20];
26-
LIBC_NAMESPACE::memset(arr, 0xAA, 2001);
27-
},
28-
WITH_SIGNAL(SIGABRT));
29-
}
30-
#endif // LIBC_HAS_ADDRESS_SANITIZER

0 commit comments

Comments
 (0)