* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / nestfunc-2.c
blob1a25a17449ee4f9b0b962fe95adec32525cb9f66
1 /* { dg-require-effective-target trampolines } */
3 extern int foo (int, int, int (*) (int, int, int, int, int, int, int));
5 int z;
7 int
8 main (void)
10 int sum = 0;
11 int i;
13 int nested (int a, int b, int c, int d, int e, int f, int g)
15 z = c + d + e + f + g;
17 if (a > 2 * b)
18 return a - b;
19 else
20 return b - a;
23 for (i = 0; i < 10; ++i)
25 int j;
27 for (j = 0; j < 10; ++j)
29 int k;
31 for (k = 0; k < 10; ++k)
32 sum += foo (i, j > k ? j - k : k - j, nested);
36 if (sum != 2300)
37 abort ();
39 if (z != 0x1b)
40 abort ();
42 exit (0);
45 int
46 foo (int a, int b, int (* fp) (int, int, int, int, int, int, int))
48 return fp (a, b, a, b, a, b, a);