ASAN: emit line information of stack variables.
[platform/upstream/linaro-gcc.git] / gcc / testsuite / gcc.dg / asan / use-after-scope-9.c
1 // { dg-do run }
2 // { dg-shouldfail "asan" }
3
4 int
5 main (int argc, char **argv)
6 {
7   int *ptr = 0;
8
9   {
10     int a;
11     ptr = &a;
12     *ptr = 12345;
13   }
14
15   return *ptr;
16 }
17
18 // { dg-output "ERROR: AddressSanitizer: stack-use-after-scope on address.*(\n|\r\n|\r)" }
19 // { dg-output "READ of size .*" }
20 // { dg-output ".*'a' \\(line 12\\) <== Memory access at offset \[0-9\]* is inside this variable.*" }