Files
clang-p2996/compiler-rt/test/hwasan/TestCases/stack-uar.c
Kostya Serebryany 1ee01bbf37 [hwasan] rename two .cc tests into .c
llvm-svn: 341739
2018-09-08 01:27:10 +00:00

24 lines
479 B
C

// RUN: %clang_hwasan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
#include <stdlib.h>
#include <sanitizer/hwasan_interface.h>
__attribute__((noinline))
char *f() {
char z[0x1000];
char *volatile p = z;
return p;
}
int main() {
return *f();
// CHECK: READ of size 1 at
// CHECK: #0 {{.*}} in main{{.*}}stack-uar.c:16
// CHECK: is located in stack of thread
// CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in main
}