1 // RUN: %clang_hwasan %s -o %t && not %run %t 2>&1 | FileCheck %s
6 #include <sanitizer/hwasan_interface.h>
9 __hwasan_enable_allocator_tagging();
10 char *p
= (char *)malloc(1);
11 fprintf(stderr
, "ALLOC %p\n", __hwasan_tag_pointer(p
, 0));
12 // CHECK: ALLOC {{[0x]+}}[[ADDR:.*]]
14 // CHECK: ERROR: HWAddressSanitizer: invalid-free on address {{.*}} at pc {{[0x]+}}[[PC:.*]] on thread T{{[0-9]+}}
15 // CHECK: #0 {{[0x]+}}{{.*}}[[PC]] in {{.*}}free
16 // CHECK: #1 {{.*}} in main {{.*}}wild-free-close.c:[[@LINE-3]]
17 // CHECK: is located 8 bytes before a 1-byte region [{{[0x]+}}{{.*}}[[ADDR]]
18 // CHECK-NOT: Segmentation fault