diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp @@ -312,6 +312,8 @@ return "SEGV"; case SIGBUS: return "BUS"; + case SIGTRAP: + return "SIGTRAP"; } return "UNKNOWN SIGNAL"; } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp new file mode 100644 --- /dev/null +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp @@ -0,0 +1,8 @@ +// RUN: %clangxx -O1 %s -o %t && %env_tool_opts=handle_sigtrap=2 not %run %t 2>&1 | FileCheck %s + +int main() { + __builtin_debugtrap(); +} + +// CHECK: Sanitizer:DEADLYSIGNAL +// CHECK: Sanitizer: SIGTRAP on unknown address