ASAN: emit line information of stack variables.
[official-gcc.git] / gcc / testsuite / g++.dg / asan / function-argument-2.C
blobbdd3dc6e49f0f9f00ae847783c1e66c01a3a0c1c
1 // { dg-do run }
2 // { dg-shouldfail "asan" }
4 static __attribute__ ((noinline)) int
5 goo (int *a)
7   return *(volatile int *)a;
10 __attribute__ ((noinline)) int
11 foo (char arg)
13   return goo ((int *)&arg);
16 int
17 main ()
19   return foo (12);
22 // { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" }
23 // { dg-output "READ of size . at.*" }
24 // { dg-output ".*'arg' \\(line 11\\) <== Memory access at offset \[0-9\]* partially overflows this variable.*" }