]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/hwasan/TestCases/stack-uar.cc
Vendor import of compiler-rt trunk r338536:
[FreeBSD/FreeBSD.git] / test / hwasan / TestCases / stack-uar.cc
1 // RUN: %clangxx_hwasan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3 // REQUIRES: stable-runtime
4
5 #include <stdlib.h>
6 #include <sanitizer/hwasan_interface.h>
7
8 __attribute__((noinline))
9 char *f() {
10   char z[0x1000];
11   char *volatile p = z;
12   return p;
13 }
14
15 int main() {
16   return *f();
17   // CHECK: READ of size 1 at
18   // CHECK: #0 {{.*}} in main{{.*}}stack-uar.cc:16
19
20   // CHECK: HWAddressSanitizer can not describe address in more detail.
21
22   // CHECK: SUMMARY: HWAddressSanitizer: tag-mismatch {{.*}} in main
23 }