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:
Sönke Holz
2024-09-02 14:26:57 +02:00
committed by Andrew Kaster
parent f0ba4d9037
commit eabf37da29
2 changed files with 1 additions and 5 deletions

View File

@@ -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)

View File

@@ -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();
}