brintos

brintos / llvm-project-archived public Read only

0
0
Text · 795 B · e13955e Raw
25 lines · c
1// RUN: %clang_hwasan -g %s -o %t && not %run %t 2>&1 | FileCheck %s2 3// Stack histories currently are not recorded on x86.4// XFAIL: target=x86_64{{.*}}5 6__attribute((noinline)) void buggy() {7  char c[64];8  char *volatile p = c;9  p[-2] = 0;10}11 12int main() {13  buggy();14  // CHECK: WRITE of size 1 at15  // CHECK: #0 {{.*}} in buggy{{.*}}stack-underflow.c:[[@LINE-6]]16  // CHECK: Cause: stack tag-mismatch17  // CHECK: is located in stack of thread18  // CHECK: Potentially referenced stack objects:19  // CHECK: Cause: stack-buffer-overflow20  // CHECK-NEXT: 0x{{.*}} is located 2 bytes before a 64-byte local variable c [0x{{.*}},0x{{.*}}) in buggy {{.*}}stack-underflow.c:21  // CHECK: Memory tags around the buggy address22 23  // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in buggy24}25