1 | // RUN: %clang_cl_asan %Od %s %Fe%t |
2 | // RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s |
3 | |
4 | // Test the error output from an illegal instruction. |
5 | |
6 | #include <stdio.h> |
7 | |
8 | int main() { |
9 | puts(s: "before ud2a" ); |
10 | fflush(stdout); |
11 | __builtin_trap(); |
12 | return 0; |
13 | } |
14 | // CHECK: before ud2a |
15 | // CHECK: ERROR: AddressSanitizer: illegal-instruction on unknown address [[ADDR:0x[^ ]*]] |
16 | // CHECK-SAME: (pc [[ADDR]] {{.*}}) |
17 | // CHECK-NEXT: #0 {{.*}} in main {{.*}}illegal_instruction.cpp:{{.*}} |
18 | |