1 // Test the handle_sigfpe option.
2 // RUN: %clangxx %s -o %t
3 // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s
4 // RUN: %env_tool_opts=handle_sigfpe=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
5 // RUN: %env_tool_opts=handle_sigfpe=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s
7 // FIXME: seems to fail on ARM
8 // REQUIRES: x86_64-target-arch
11 #include <sanitizer/asan_interface.h>
14 fprintf(stderr
, "DEATH CALLBACK\n");
17 int main(int argc
, char **argv
) {
18 __sanitizer_set_death_callback(death
);
20 volatile int zero
= 0;
25 // CHECK0-NOT: Sanitizer:DEADLYSIGNAL
26 // CHECK1: ERROR: {{.*}}Sanitizer: FPE
27 // CHECK1: {{#[0-9]+.* main .*fpe\.cpp}}:[[@LINE-5]]
28 // CHECK1: DEATH CALLBACK
29 // CHECK0-NOT: {{.*}}Sanitizer: FPE