[PATCH] RISC-V: Bugfix for unrecognizable insn for XTheadVector
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / nestfunc-2.c
blobd5c5280a27e111ba610ca06060929a3b9caf8e61
1 /* { dg-require-effective-target trampolines } */
3 void abort (void);
4 void exit (int);
6 extern int foo (int, int, int (*) (int, int, int, int, int, int, int));
8 int z;
10 int
11 main (void)
13 int sum = 0;
14 int i;
16 int nested (int a, int b, int c, int d, int e, int f, int g)
18 z = c + d + e + f + g;
20 if (a > 2 * b)
21 return a - b;
22 else
23 return b - a;
26 for (i = 0; i < 10; ++i)
28 int j;
30 for (j = 0; j < 10; ++j)
32 int k;
34 for (k = 0; k < 10; ++k)
35 sum += foo (i, j > k ? j - k : k - j, nested);
39 if (sum != 2300)
40 abort ();
42 if (z != 0x1b)
43 abort ();
45 exit (0);
48 int
49 foo (int a, int b, int (* fp) (int, int, int, int, int, int, int))
51 return fp (a, b, a, b, a, b, a);