1 // This is the ASAN test of the same name ported to HWAsan.
3 // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -std=c++11 -O1 %s -o %t && \
4 // RUN: not %run %t 2>&1 | FileCheck %s
6 // REQUIRES: aarch64-target-arch
7 // REQUIRES: stable-runtime
13 const IntHolder
*saved
;
15 __attribute__((noinline
)) void save(const IntHolder
&holder
) {
19 int main(int argc
, char *argv
[]) {
21 int x
= saved
->val
; // BOOM
22 // CHECK: ERROR: HWAddressSanitizer: tag-mismatch
23 // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp.cpp:[[@LINE-2]]
24 // CHECK: Cause: stack tag-mismatch