[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / use-after-scope-if.cpp
blob94a9d413d4adcadb2c4c9eb41736702d86f8670a
1 // This is the ASAN test of the same name ported to HWAsan.
3 // RUN: %clangxx_hwasan -O1 %s -o %t && \
4 // RUN: not %run %t 2>&1 | FileCheck %s
6 // REQUIRES: aarch64-target-arch || riscv64-target-arch
8 int *p;
9 bool b = true;
11 int main() {
12 if (b) {
13 int x[5];
14 p = x + 1;
16 return *p; // BOOM
17 // CHECK: ERROR: HWAddressSanitizer: tag-mismatch
18 // CHECK: #0 0x{{.*}} in main {{.*}}.cpp:[[@LINE-2]]
19 // CHECK: Cause: stack tag-mismatch