ASAN: emit line information of stack variables.
[official-gcc.git] / gcc / testsuite / gcc.dg / asan / pr78541.c
blob612c7e5807197c581619fedc1b2d48fbb34d50a2
1 // PR sanitizer/78560
2 // { dg-do run }
3 // { dg-shouldfail "asan" }
5 void foo (double a, double b)
7 double *ptr;
9 double x = a + b;
10 ptr = &x;
12 double square () { __builtin_printf ("", *ptr); }
14 square ();
17 int main()
19 foo (1.2f, 2.3f);
20 return 0;
23 // { dg-output "ERROR: AddressSanitizer: stack-use-after-scope on address.*(\n|\r\n|\r)" }
24 // { dg-output "READ of size.*" }
25 // { dg-output ".*'x' \\(line 9\\) <== Memory access at offset \[0-9\]* is inside this variable.*" }