gcc/testsuite/gcc.dg/c23-parm-omit-3.c
raw| 1 | /* Test omitted parameter names in C23. Execution test. */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 | |
| 5 | extern void abort (void); |
| 6 | extern void exit (int); |
| 7 | |
| 8 | void |
| 9 | f (int a, int [++a], int b) |
| 10 | { |
| 11 | /* Verify array size expression of unnamed parameter is processed as |
| 12 | expected. */ |
| 13 | if (a != 2 || b != 3) |
| 14 | abort (); |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main (void) |
| 19 | { |
| 20 | int t[2]; |
| 21 | f (1, t, 3); |
| 22 | exit (0); |
| 23 | } |