1 // { dg-do run } 2 // { dg-shouldfail "asan" } 3 // { dg-additional-options "-Wno-psabi" } 4 5 typedef int v4si __attribute__ ((vector_size (16))); 6 7 static __attribute__ ((noinline)) int goo(v4si * a)8goo (v4si *a) 9 { 10 return (*(volatile v4si *) (a + 1))[2]; 11 } 12 13 __attribute__ ((noinline)) int foo(v4si arg)14foo (v4si arg) 15 { 16 return goo (&arg); 17 } 18 19 int main()20main () 21 { 22 v4si v = {1,2,3,4}; 23 return foo (v); 24 } 25 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' <== Memory access at offset \[0-9\]* overflows this variable.*" } 29