Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu23-empty-init-1.c
blob2933041aeddf6f2d1aab7ade2fb432e0ec55a1f9
1 /* Test C23 support for empty initializers: valid use cases with GNU
2 extensions. */
3 /* { dg-do run } */
4 /* { dg-options "-std=gnu23" } */
6 extern void exit (int);
7 extern void abort (void);
9 void
10 f (int a)
12 struct s { volatile int x[a]; };
13 struct s b = {};
14 for (int i = 0; i < a; i++)
15 if (b.x[i] != 0)
16 abort ();
17 /* Overwrite contents of b.x before second call to make it more likely stack
18 contents are nonzero if proper initialization did not occur. */
19 for (int i = 0; i < a; i++)
20 b.x[i] = -1;
23 int
24 main (void)
26 f (100);
27 f (100);
28 exit (0);