diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-08-05 16:48:12 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-08-05 16:48:12 +0000 |
commit | 673dc3d4a0b0fbb3b9b34ae2ecbfa522627fe582 (patch) | |
tree | 93e9f9c3508af096ba717ef85186950135b4c225 /compiler-rt/test/asan/TestCases/ill.cpp | |
parent | a96cfee98a22e262367868f343b599c2312149b7 (diff) | |
download | bcm5719-llvm-673dc3d4a0b0fbb3b9b34ae2ecbfa522627fe582.tar.gz bcm5719-llvm-673dc3d4a0b0fbb3b9b34ae2ecbfa522627fe582.zip |
compiler-rt: Rename cc files below test/asan to cpp
See r367803 and similar other changes.
llvm-svn: 367887
Diffstat (limited to 'compiler-rt/test/asan/TestCases/ill.cpp')
-rw-r--r-- | compiler-rt/test/asan/TestCases/ill.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler-rt/test/asan/TestCases/ill.cpp b/compiler-rt/test/asan/TestCases/ill.cpp new file mode 100644 index 00000000000..d7b53509167 --- /dev/null +++ b/compiler-rt/test/asan/TestCases/ill.cpp @@ -0,0 +1,31 @@ +// Test the handle_sigill option. +// +// RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=0 not --crash %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0 +// RUN: %clangxx_asan %s -o %t && %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1 +// REQUIRES: x86-target-arch + +#ifdef _WIN32 +#include <windows.h> +#endif + +int main(int argc, char **argv) { +#ifdef _WIN32 + // Sometimes on Windows this test generates a WER fault dialog. Suppress that. + UINT new_flags = SEM_FAILCRITICALERRORS | + SEM_NOGPFAULTERRORBOX | + SEM_NOOPENFILEERRORBOX; + // Preserve existing error mode, as discussed at + // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx + UINT existing_flags = SetErrorMode(new_flags); + SetErrorMode(existing_flags | new_flags); +#endif + + if (argc) + __builtin_trap(); + // Unreachable code to avoid confusing the Windows unwinder. +#ifdef _WIN32 + SetErrorMode(0); +#endif +} +// CHECK0-NOT: ERROR: AddressSanitizer +// CHECK1: ERROR: AddressSanitizer: {{ILL|illegal-instruction}} on unknown address {{0x0*}} |