1 // Test the handle_sigill option.
3 // RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=0 not --crash %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
4 // RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
5 // REQUIRES: x86-target-arch
11 int main(int argc
, char **argv
) {
13 // Sometimes on Windows this test generates a WER fault dialog. Suppress that.
14 UINT new_flags
= SEM_FAILCRITICALERRORS
|
15 SEM_NOGPFAULTERRORBOX
|
16 SEM_NOOPENFILEERRORBOX
;
17 // Preserve existing error mode, as discussed at
18 // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx
19 UINT existing_flags
= SetErrorMode(new_flags
);
20 SetErrorMode(existing_flags
| new_flags
);
25 // Unreachable code to avoid confusing the Windows unwinder.
30 // CHECK0-NOT: ERROR: AddressSanitizer
31 // CHECK1: ERROR: AddressSanitizer: {{ILL|illegal-instruction}} on unknown address {{0x0*}}