diff options
| author | Reid Kleckner <rnk@google.com> | 2016-08-05 21:47:46 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2016-08-05 21:47:46 +0000 |
| commit | 9cba2e2d97e88633bf5a42ec2f73121f0a72a8d4 (patch) | |
| tree | 5d54fc0a67efe65a2916201994640bb9f1169d48 /compiler-rt/test | |
| parent | 7af95876cf8f289f0d8d1fb0c0411464898ed641 (diff) | |
| download | bcm5719-llvm-9cba2e2d97e88633bf5a42ec2f73121f0a72a8d4.tar.gz bcm5719-llvm-9cba2e2d97e88633bf5a42ec2f73121f0a72a8d4.zip | |
Fix two tests in Win64 ASan
Go back to intercepting kernel32!RaiseException, and only go for
ntdll!RtlRaiseException if that fails. Fixes throw_and_catch.cc test.
Work around an issue in LLVM's win64 epilogues. We end up with an
epilogue that looks like this, and it drives the Win64 unwinder crazy
until stack overflow:
call ill_cc!__asan_handle_no_return
xor eax,eax
add rsp,40h // epilogue starts
pop rbp // CSR
ud2 // Trap here
ret // Ret?
nop word ptr [rax+rax]
sub rsp,28h // Next function
Will file a PR soon.
llvm-svn: 277874
Diffstat (limited to 'compiler-rt/test')
| -rw-r--r-- | compiler-rt/test/asan/TestCases/Windows/dll_host.cc | 1 | ||||
| -rw-r--r-- | compiler-rt/test/asan/TestCases/ill.cc | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_host.cc b/compiler-rt/test/asan/TestCases/Windows/dll_host.cc index 72094607697..6a029c96d4d 100644 --- a/compiler-rt/test/asan/TestCases/Windows/dll_host.cc +++ b/compiler-rt/test/asan/TestCases/Windows/dll_host.cc @@ -24,6 +24,7 @@ // IMPORT: __asan_wrap_HeapReAlloc // IMPORT: __asan_wrap_HeapSize // IMPORT: __asan_wrap_CreateThread +// IMPORT: __asan_wrap_RaiseException // IMPORT: __asan_wrap_RtlRaiseException // // The exception handlers differ in 32-bit and 64-bit, so we ignore them: diff --git a/compiler-rt/test/asan/TestCases/ill.cc b/compiler-rt/test/asan/TestCases/ill.cc index fae837c32fa..cad1584e3e9 100644 --- a/compiler-rt/test/asan/TestCases/ill.cc +++ b/compiler-rt/test/asan/TestCases/ill.cc @@ -9,7 +9,7 @@ #include <windows.h> #endif -int main() { +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 | @@ -21,7 +21,10 @@ int main() { SetErrorMode(existing_flags | new_flags); #endif - __builtin_trap(); + if (argc) + __builtin_trap(); + // Unreachable code to avoid confusing the Windows unwinder. + SetErrorMode(0); } // CHECK0-NOT: ERROR: AddressSanitizer // CHECK1: ERROR: AddressSanitizer: {{ILL|illegal-instruction}} on unknown address {{0x0*}} |

