2 // RUN: %clang_gwp_asan -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer %s -g -o %t
3 // RUN: %expect_crash %t 2>&1 | FileCheck %s
5 // Ensure we don't crash when using the unwinder when frame pointers are
7 // RUN: %clang_gwp_asan -fomit-frame-pointer -momit-leaf-frame-pointer %s -g -o %t
8 // RUN: %expect_crash %t
10 // Incomplete backtrace on Armv7
11 // UNSUPPORTED: armhf-linux
15 __attribute__((noinline
)) void *allocate_mem() { return malloc(1); }
17 __attribute__((noinline
)) void free_mem(void *ptr
) { free(ptr
); }
19 __attribute__((noinline
)) void touch_mem(void *ptr
) {
20 volatile char sink
= *((volatile char *)ptr
);
23 // CHECK: Use After Free
25 // CHECK: was deallocated
27 // CHECK: was allocated
28 // CHECK: allocate_mem
31 for (unsigned i
= 0; i
< 0x10000; ++i
) {
32 void *ptr
= allocate_mem();