ASAN: emit line information of stack variables.
[official-gcc.git] / gcc / testsuite / g++.dg / asan / function-argument-3.C
blob26b3f9268afe2dd9de8ee2f5493ebaaec5c9dcee
1 // { dg-do run }
2 // { dg-shouldfail "asan" }
3 // { dg-additional-options "-Wno-psabi" }
5 typedef int v4si __attribute__ ((vector_size (16)));
7 static __attribute__ ((noinline)) int
8 goo (v4si *a)
10   return (*(volatile v4si *) (a + 1))[2];
13 __attribute__ ((noinline)) int
14 foo (v4si arg)
16   return goo (&arg);
19 int
20 main ()
22   v4si v = {1,2,3,4};
23   return foo (v);
26 // { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" }
27 // { dg-output "READ of size . at.*" }
28 // { dg-output ".*'arg' \\(line 14\\) <== Memory access at offset \[0-9\]* overflows this variable.*" }