libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / pr57359-2.c
blobce7d9890af46d35a9c9023c4f16288bfe9f3e4a0
1 /* { dg-do run } */
2 /* { dg-additional-options "-fstrict-aliasing" } */
4 extern void abort();
6 typedef int A;
7 typedef float B;
9 void __attribute__((noipa))
10 foo(A * p, B *r, long unk, long oh)
12 for (long i = 0; i < unk; ++i) {
13 *p = 1;
14 *r = 2;
15 if (oh & i)
16 break;
17 *r = 3;
18 *p = 4;
22 int main(void)
24 union { A x; B f; } u;
25 foo(&u.x, &u.f, 1, 1);
26 if (u.x != 4) abort();
27 foo(&u.x, &u.f, 2, 1);
28 if (u.f != 2) abort ();
29 return 0;