summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/handle_noreturn_bug.cpp
blob: 8c3c66a423d50cc05fbc0e2b71376cc0b3c7029d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Regression test: __asan_handle_no_return should unpoison stack even with poison_heap=0.
// RUN: %clangxx_asan -O0 %s -o %t && \
// RUN: %env_asan_opts=poison_heap=1 %run %t && \
// RUN: %env_asan_opts=poison_heap=0 %run %t

#include <sanitizer/asan_interface.h>

int main(int argc, char **argv) {
  int x[2];
  int * volatile p = &x[0];
  __asan_handle_no_return();
  int volatile z = p[2];
}