1// RUN: %clang_hwasan -g %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3// Dynamic stack realignment causes debug info locations to use non-FP-relative
4// offsets because stack frames are realigned below FP, which means that we
5// can't associate addresses with stack objects in this case. Ideally we should
6// be able to handle this case somehow (e.g. by using a different register for
7// DW_AT_frame_base) but at least we shouldn't get confused by it.
8
9// REQUIRES: pointer-tagging
10
11__attribute((noinline))
12char *buggy() {
13 _Alignas(64) char c[64];
14 char *volatile p = c;
15 return p;
16}
17
18int main() {
19 char *p = buggy();
20 // CHECK-NOT: Potentially referenced stack objects:
21 p[0] = 0;
22}
23

source code of compiler-rt/test/hwasan/TestCases/stack-uar-realign.c