OSDN Git Service

PR c/17844
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtin-return-1.c
1 /* PR middle-end/11151 */
2 /* Originator: Andrew Church <gcczilla@achurch.org> */
3 /* { dg-do run } */
4
5 /* This used to fail on SPARC because the (undefined) return
6    value of 'bar' was overwriting that of 'foo'.  */
7
8 extern void abort(void);
9
10 int foo(int n)
11 {
12   return n+1;
13 }
14
15 int bar(int n)
16 {
17   __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
18 }
19
20 int main(void)
21 {
22   if (bar(1) != 2)
23     abort();
24
25   return 0;
26 }