[compiler-rt] r374010 - [sanitizer] Fix signal_trap_handler.cpp on android
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 7 19:00:53 PDT 2019
Author: vitalybuka
Date: Mon Oct 7 19:00:53 2019
New Revision: 374010
URL: http://llvm.org/viewvc/llvm-project?rev=374010&view=rev
Log:
[sanitizer] Fix signal_trap_handler.cpp on android
Modified:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp
Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp?rev=374010&r1=374009&r2=374010&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/signal_trap_handler.cpp Mon Oct 7 19:00:53 2019
@@ -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;
+}
More information about the llvm-commits
mailing list