* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / asan / use-after-scope-3.c
blobddf3c04eb456bbb8ba87628a565c59422b39f43f
1 // { dg-do run }
2 // { dg-shouldfail "asan" }
3 // { dg-skip-if "" { *-*-* } { "*" } { "-O0" } }
5 int
6 main (void)
8 char *ptr;
9 char *ptr2;
11 char my_char[9];
12 ptr = &my_char[0];
13 __builtin_memcpy (&ptr2, &ptr, sizeof (ptr2));
16 *(ptr2+9) = 'c';
19 // { dg-output "ERROR: AddressSanitizer: stack-use-after-scope on address.*(\n|\r\n|\r)" }
20 // { dg-output "WRITE of size 1 at.*" }
21 // { dg-output ".*'my_char' <== Memory access at offset \[0-9\]* overflows this variable.*" }