* c-c++-common/ubsan/float-cast-overflow-6.c: Add i?86-*-* target.
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-return-1.c
blob68fd0556b3db49ac8f99ab88598ef6f15f0f268c
1 /* PR middle-end/11151 */
2 /* Originator: Andrew Church <gcczilla@achurch.org> */
3 /* { dg-do run } */
4 /* { dg-xfail-run-if "PR36571 untyped return is char register" { "avr-*-*" } { "*" } { "" } } */
5 /* This used to fail on SPARC because the (undefined) return
6 value of 'bar' was overwriting that of 'foo'. */
8 extern void abort(void);
10 int foo(int n)
12 return n+1;
15 int bar(int n)
17 __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
20 char *g;
22 int main(void)
24 /* Allocate 64 bytes on the stack to make sure that __builtin_apply
25 can read at least 64 bytes above the return address. */
26 char dummy[64];
28 g = dummy;
30 if (bar(1) != 2)
31 abort();
33 return 0;