1 // RUN: %clang_hwasan_oldrt -DSIZE=2 -O0 %s -o %t && %run %t
2 // RUN: %clang_hwasan -DSIZE=2 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // RUN: %clang_hwasan_oldrt -DSIZE=15 -O0 %s -o %t && %run %t
4 // RUN: %clang_hwasan -DSIZE=15 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 // RUN: %clang_hwasan_oldrt -DSIZE=16 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
6 // RUN: %clang_hwasan -DSIZE=16 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
7 // RUN: %clang_hwasan -DSIZE=64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
8 // RUN: %clang_hwasan -DSIZE=0x1000 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
10 // Stack short granules are currently not implemented on x86.
11 // RISC-V target doesn't support oldrt
12 // XFAIL: target={{(x86_64|riscv64).*}}
15 #include <sanitizer/hwasan_interface.h>
17 __attribute__((noinline
))
26 // CHECK: READ of size 1 at
27 // CHECK: #0 {{.*}} in f{{.*}}stack-oob.c:[[@LINE-6]]
29 // CHECK-NOT: Cause: global-overflow
30 // CHECK: Cause: stack tag-mismatch
31 // CHECK: is located in stack of threa
32 // CHECK-NOT: Cause: global-overflow
34 // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in f