aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-parm-omit-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/c23-parm-omit-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/c23-parm-omit-3.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c23-parm-omit-3.c b/gcc/testsuite/gcc.dg/c23-parm-omit-3.c
new file mode 100644
index 0000000..6e48410
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-parm-omit-3.c
@@ -0,0 +1,23 @@
+/* Test omitted parameter names in C23. Execution test. */
+/* { dg-do run } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void
+f (int a, int [++a], int b)
+{
+ /* Verify array size expression of unnamed parameter is processed as
+ expected. */
+ if (a != 2 || b != 3)
+ abort ();
+}
+
+int
+main (void)
+{
+ int t[2];
+ f (1, t, 3);
+ exit (0);
+}