1 // RUN: %clang_hwasan -g %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3 // Dynamic allocation of stack objects does not affect FP, so the backend should
4 // still be using FP-relative debug info locations that we can use to find stack
5 // objects.
6
7 __attribute((noinline))
buggy(int b)8 char *buggy(int b) {
9 char c[64];
10 char *volatile p = c;
11 if (b) {
12 p = __builtin_alloca(64);
13 p = c;
14 }
15 return p;
16 }
17
main()18 int main() {
19 char *p = buggy(1);
20 // CHECK: Potentially referenced stack objects:
21 // CHECK-NEXT: c in buggy
22 p[0] = 0;
23 }
24