libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-tag-alias-6.c
blob586965f3eac3868de4a2335f69fffce00e2d57bd
1 /* { dg-do run }
2 * { dg-options "-std=c23 -O2" }
3 */
6 /* These tests check that a composite type for a struct
7 * can alias the original definition. */
9 struct foo { int (*y)[]; int x; } s;
11 int test_foo(struct foo* a, void* b)
13 a->x = 1;
15 struct foo { int (*y)[1]; int x; } t;
16 typeof(*(1 ? &s: &t)) *p = b;
17 p->x = 2;
19 return a->x;
23 int main()
25 struct foo y;
27 if (2 != test_foo(&y, &y))
28 __builtin_abort();
30 return 0;