gcc/testsuite/gcc.c-torture/execute/nestfunc-1.c
raw| 1 | /* { dg-require-effective-target trampolines } */ |
| 2 | |
| 3 | void abort (void); |
| 4 | void exit (int); |
| 5 | |
| 6 | int |
| 7 | g (int a, int b, int (*gi) (int, int)) |
| 8 | { |
| 9 | if ((*gi) (a, b)) |
| 10 | return a; |
| 11 | else |
| 12 | return b; |
| 13 | } |
| 14 | |
| 15 | void |
| 16 | f () |
| 17 | { |
| 18 | int i, j; |
| 19 | int f2 (int a, int b) |
| 20 | { |
| 21 | return a > b; |
| 22 | } |
| 23 | |
| 24 | if (g (1, 2, f2) != 2) |
| 25 | abort (); |
| 26 | } |
| 27 | |
| 28 | int |
| 29 | main (void) |
| 30 | { |
| 31 | f (); |
| 32 | exit (0); |
| 33 | } |