libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-complit-1.c
blobc259d625dcc4b9668516ad89ffc7896376bcaf15
1 /* Test storage duration of compound literals in parameter lists for C23. */
2 /* { dg-do run } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
5 extern void abort (void);
6 extern void exit (int);
8 int x;
10 void f (int a[(int) { x }]);
12 int *q;
14 int
15 fp (int *p)
17 q = p;
18 return 1;
21 void
22 g (int a, int b[fp ((int [2]) { a, a + 2 })])
24 if (q[0] != a || q[1] != a + 2)
25 abort ();
28 int
29 main (void)
31 int t[1] = { 0 };
32 g (1, t);
33 g (2, t);
34 exit (0);