18 lines · c
1// RUN: %clang_hwasan -Wl,--build-id=0xaba493998257fbdd %s -o %t2// RUN: %env_hwasan_opts=symbolize=0 not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,NOSYM3// RUN: not %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,SYM4 5#include <stdlib.h>6 7#include <sanitizer/hwasan_interface.h>8 9int main(int argc, char **argv) {10 __hwasan_enable_allocator_tagging();11 char *buf = (char *)malloc(1);12 buf[32] = 'x';13 // CHECK: ERROR: HWAddressSanitizer: tag-mismatch14 // NOSYM: 0x{{.*}} {{.*}}build-ids.c{{.*}} (BuildId: aba493998257fbdd)15 // SYM: 0x{{.*}} in main {{.*}}build-ids.c:[[@LINE-3]]:{{[0-9]+}}16 return 0;17}18