libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr109303.c
blobf91535991c78cbc1360be2e4f2d0b88eeb0513cc
1 /* PR ipa/109303 */
2 /* { dg-do compile { target lp64 } } */
3 /* { dg-options "-O2" } */
5 struct __attribute__((packed)) A { char c1; short a1[__INT_MAX__]; };
6 struct __attribute__((packed)) B { char c2; short a2[100]; };
7 struct S { struct A p1; struct B p2[4]; };
8 void bar (short int);
10 static void
11 foo (struct S *q)
13 for (int i = 0; i < q->p1.c1; i++)
14 for (int j = 0; j < q->p2[i].c2; j++)
15 bar (q->p2[i].a2[j]);
18 int
19 main ()
21 struct S q = {};
22 q.p2[0].c2 = q.p2[1].c2 = 3;
23 foo (&q);