[docs] Fix build-docs.sh
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / use-after-scope.cpp
blob28648e4804860bf31f9d61dd7bec2fbfcea3bd51
1 // This is the ASAN test of the same name ported to HWAsan.
3 // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && \
4 // RUN: not %run %t 2>&1 | FileCheck %s
6 // REQUIRES: aarch64-target-arch
7 // REQUIRES: stable-runtime
9 volatile int *p = 0;
11 int main() {
13 int x = 0;
14 p = &x;
16 *p = 5; // BOOM
17 // CHECK: ERROR: HWAddressSanitizer: tag-mismatch
18 // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope.cpp:[[@LINE-2]]
19 // CHECK: Cause: stack tag-mismatch
20 return 0;