PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / guality / pr56154-1.c
blob4f02bc96e219b77424eeea7b61df31f8257633d2
1 /* PR debug/56154 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
4 /* { dg-additional-sources "pr56154-aux.c" } */
6 #include "../nop.h"
8 union U { int a, b; };
9 volatile int z;
11 __attribute__((noinline, noclone)) int
12 foo (int fd, union U x)
14 int result = x.a != 0;
15 if (fd != 0)
16 result = x.a == 0;
17 asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-1.c:17 "x.a" "4" } } */
18 z = x.a;
19 x.a = 6;
20 asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-1.c:20 "x.a" "6" } } */
21 return result;
24 void
25 test_main (void)
27 union U u = { .a = 4 };
28 foo (0, u);