1 // RUN: %clangxx_hwasan %s -o %t && not %run %t 2>&1 | FileCheck %s
6 #include <sanitizer/hwasan_interface.h>
8 __attribute__((no_sanitize("hwaddress"))) extern "C" void callback(const char *msg
) {
9 fprintf(stderr
, "== error start\n%s\n== error end\n", msg
);
13 __hwasan_enable_allocator_tagging();
14 __hwasan_set_error_report_callback(&callback
);
15 char *volatile p
= (char *)malloc(16);
18 // CHECK: ERROR: HWAddressSanitizer:
19 // CHECK: WRITE of size 1 at
20 // CHECK: allocated by thread {{.*}} here:
21 // CHECK: Memory tags around the buggy address
23 // CHECK: == error start
24 // CHECK: ERROR: HWAddressSanitizer:
25 // CHECK: WRITE of size 1 at
26 // CHECK: allocated by thread {{.*}} here:
27 // CHECK: Memory tags around the buggy address
28 // CHECK: == error end