1 /* Test C23 storage class specifiers in compound literals. */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
7 extern void abort (void);
8 extern void exit (int);
10 /* static is OK (although redundant) at file scope. */
11 int *ps
= &(static int) { 1 };
12 size_t ss
= sizeof (static int) { 1 };
13 int *psa
= (static int [3]) { 1, 2, 3 };
20 if (ss
!= sizeof (int))
22 if (psa
[0] != 1 || psa
[1] != 2 || psa
[2] != 3)
24 if ((register int) { 3 } != 3)
26 /* A static compound literal, like a static variable, is initialized once,
27 but an automatic compound literal is initialized every time it is reached
28 in the order of execution. */
31 int *p
= &(static int) { 0 };
40 int *p2
= &(int) { 0 };