]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.c-torture/execute/frame-address.c
5afa691e4093b8b20144ba121ca4d34b4bc66009
1 /* { dg-require-effective-target return_address } */
4 int check_fa_work (const char *, const char *) __attribute__((noinline
));
5 int check_fa_mid (const char *) __attribute__((noinline
));
6 int check_fa (char *) __attribute__((noinline
));
7 int how_much (void) __attribute__((noinline
));
9 int check_fa_work (const char *c
, const char *f
)
14 return c
>= f
&& f
>= &d
;
16 return c
<= f
&& f
<= &d
;
19 int check_fa_mid (const char *c
)
21 const char *f
= __builtin_frame_address (0);
23 /* Prevent a tail call to check_fa_work, eliding the current stack frame. */
24 return check_fa_work (c
, f
) != 0;
27 int check_fa (char *unused
)
31 /* Prevent a tail call to check_fa_mid, eliding the current stack frame. */
32 return check_fa_mid (&c
) != 0;
42 char *unused
= __builtin_alloca (how_much ());
44 if (!check_fa(unused
))