1 /* PR debug/56154 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
4 /* { dg-additional-sources "pr56154-aux.c" } */
5 
6 #include "../nop.h"
7 
8 union U { int a, b; };
9 volatile int z;
10 
11 __attribute__((noinline, noclone)) int
foo(int fd,union U x)12 foo (int fd, union U x)
13 {
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;
22 }
23 
24 void
test_main(void)25 test_main (void)
26 {
27   union U u = { .a = 4 };
28   foo (0, u);
29 }
30