mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
Tests/LibC+LibC: Don't assume __builtin_trap causes SIGILL
__builtin_trap() gets compiled to a breakpoint instruction on riscv64 GCC, aarch64 GCC, and aarch64 Clang.
This commit is contained in:
committed by
Andrew Kaster
parent
f0ba4d9037
commit
eabf37da29
@@ -15,10 +15,6 @@ TEST_CASE(_abort)
|
||||
_abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
EXPECT_CRASH_WITH_SIGNAL("This should _abort with SIGILL signal", SIGILL, [] {
|
||||
_abort();
|
||||
return Test::Crash::Failure::DidNotCrash;
|
||||
});
|
||||
}
|
||||
|
||||
TEST_CASE(abort)
|
||||
|
||||
@@ -377,7 +377,7 @@ int atexit(void (*handler)())
|
||||
void _abort()
|
||||
{
|
||||
// According to the GCC manual __builtin_trap() can call abort() so using it here might not seem safe at first. However,
|
||||
// on all the platforms we support GCC emits an undefined instruction instead of a call.
|
||||
// on all the platforms we support GCC emits a trapping instruction instead of a call.
|
||||
__builtin_trap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user