libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-tag-incomplete-alias-1.c
blobf9ec48645e99fcd2b9bfa5b44e1be23c03a8b606
1 /* { dg-do run }
2 * { dg-options "-std=c23 -O2" } */
4 [[gnu::noinline]]
5 void *alias(void *ap, void *bp, void *x, void *y)
7 struct foo { struct bar *f; } *a = ap;
8 struct bar { long x; };
10 a->f = x;
13 struct bar;
14 struct foo { struct bar *f; } *b = bp;
15 struct bar { long x; };
17 // after completing bar, the two struct foo should be compatible
19 b->f = y;
23 return a->f;
26 int main()
28 struct bar { long x; };
29 struct foo { struct bar *f; } a;
30 struct bar x, y;
31 if (&y != alias(&a, &a, &x, &y))
32 __builtin_abort();
34 return 0;