* tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new block.
[official-gcc.git] / gcc / testsuite / gcc.dg / trampoline-1.c
blob88078621066bdf14d2d59240f4b58c8524e0239b
1 /* PR target/12865 */
2 /* Origin: Waldek Hebisch <hebisch@math.uni.wroc.pl> */
4 /* { dg-do run } */
5 /* { dg-options "-O2" } */
7 /* This used to fail on various versions of Solaris 2 because the
8 trampoline couldn't be made executable. */
10 extern void abort(void);
11 extern double fabs(double);
13 void foo (void)
15 const int correct[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
16 int i;
18 double x1 (void) {return 1; }
19 double x2 (void) {return -1;}
20 double x3 (void) {return -1;}
21 double x4 (void) {return 1; }
22 double x5 (void) {return 0; }
24 typedef double pfun(void);
26 double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5)
28 double b (void)
30 k = k - 1;
31 return a (k, b, x1, x2, x3, x4 );
34 if (k <= 0)
35 return x4 () + x5 ();
36 else
37 return b ();
40 for (i=0; i<=10; i++)
42 if (fabs(a( i, x1, x2, x3, x4, x5 ) - correct [i]) > 0.1)
43 abort();
47 int main (void)
49 foo ();
50 return 0;