1 /* { dg-do compile { target arm*-*-*} } */
2 /* { dg-options "-fno-builtin-malloc -fno-builtin-free -fno-builtin-memset
3 * -fno-omit-frame-pointer -marm -Wa,-mimplicit-it=arm" } */
4 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 /* { dg-shouldfail "asan" } */
11 void *memset (void *, int, __SIZE_TYPE__);
12 void *malloc (__SIZE_TYPE__);
16 __asan_default_options () {
17 return "fast_unwind_on_fatal=true";
23 volatile int ten = 10;
24 __attribute__ ((noinline)) int
27 char *x = (char *) malloc (10);
29 int res = x[ten]; /* BOOOM */
34 __attribute__ ((noinline)) int
41 main (int argc, char **argv)
46 /* { dg-output "READ of size 1 at 0x\[0-9a-f\]+ thread T0.*(\n|\r\n|\r)" } */
47 /* { dg-output " #0 0x\[0-9a-f\]+ +(in \[^\n\r]*foo\[^\n\r]*fast-unwind.c:29|\[(\]).*(\n|\r\n|\r)" } */
48 /* { dg-output " #1 0x\[0-9a-f\]+ +(in \[^\n\r]*bar\[^\n\r]*fast-unwind.c:37|\[(\]).*(\n|\r\n|\r)" } */
49 /* { dg-output " #2 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*fast-unwind.c:43|\[^\n\r]*:0)|\[(\]).*(\n|\r\n|\r)" } */