diff options
author | Vitaly Buka <vitalybuka@google.com> | 2019-10-08 02:00:53 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2019-10-08 02:00:53 +0000 |
commit | 52ad1a728a9295f34debe1541d82ae391df87b8b (patch) | |
tree | cc57014e02e9a6fb10e7aa4d42766e5ab8fd0daf /test/sanitizer_common/TestCases/Linux | |
parent | 12a9be541d8e64026106c6f453702c779c7f1e97 (diff) | |
download | compiler-rt-52ad1a728a9295f34debe1541d82ae391df87b8b.tar.gz |
[sanitizer] Fix signal_trap_handler.cpp on android
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common/TestCases/Linux')
-rw-r--r-- | test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp b/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp index 9b4bc067e..f7af8aa85 100644 --- a/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp +++ b/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp @@ -3,11 +3,15 @@ #include <assert.h> #include <signal.h> #include <stdio.h> +#include <stdlib.h> -int handled; +int in_handler; void handler(int signo, siginfo_t *info, void *uctx) { - handled = 1; + fprintf(stderr, "in_handler: %d\n", in_handler); + fflush(stderr); + // CHECK: in_handler: 1 + _Exit(0); } int main() { @@ -21,9 +25,10 @@ int main() { assert(a.sa_sigaction == handler); assert(a.sa_flags & SA_SIGINFO); + in_handler = 1; __builtin_debugtrap(); - assert(handled); - fprintf(stderr, "HANDLED %d\n", handled); -} + in_handler = 0; -// CHECK: HANDLED 1 + fprintf(stderr, "UNREACHABLE\n"); + return 1; +} |