| 1 | // Regression test: __asan_handle_no_return should unpoison stack even with poison_heap=0. |
| 2 | // Fails with debug checks: https://bugs.llvm.org/show_bug.cgi?id=46862 |
| 3 | // XFAIL: !compiler-rt-optimized |
| 4 | // RUN: %clangxx_asan -O0 %s -o %t |
| 5 | // RUN: %env_asan_opts=detect_stack_use_after_return=0:poison_heap=1 %run %t |
| 6 | // RUN: %env_asan_opts=detect_stack_use_after_return=0:poison_heap=0 %run %t |
| 7 | |
| 8 | #include <sanitizer/asan_interface.h> |
| 9 | |
| 10 | int main(int argc, char **argv) { |
| 11 | int x[2]; |
| 12 | int * volatile p = &x[0]; |
| 13 | __asan_handle_no_return(); |
| 14 | int volatile z = p[2]; |
| 15 | } |
| 16 | |