1 /* Test case for PR/67443. */
3 /* { dg-do run { target s390*-*-* } } */
4 /* { dg-prune-output "call-clobbered register used for global register variable" } */
5 /* { dg-options "-march=z900 -fPIC -fomit-frame-pointer -O3 -save-temps" } */
15 __attribute__ ((noinline
))
21 __attribute__ ((noinline
))
22 void foo (struct s_t
*ps
, int c
)
26 /* Uses r2 as address register. */
28 /* Clobber all registers that r2 could be stored into. */
29 __asm__
__volatile__ ("" : : : "memory",
30 "r0","r1","r6","r7","r8","r9","r10","r11");
31 /* Force that the pointer is evicted from r2 and stored on the stack. */
33 /* User the pointer again. It gets reloaded to a different register because
34 r2 is already occupied. */
36 /* If dead store elimination fails to detect that the address in r2 during
37 the first assignment is an alias of the address in rX during the second
38 assignment, it eliminates the first assignment and the f1 field is not
41 /* Make sure that r2 is used only once as an address register for storing.
42 If this check fails, the test case needs to be fixed.
43 { dg-final { scan-assembler-times "\tst.\?\t.*,0\\(%r2\\)" 1 } } */
47 struct s_t s
= { 0x01u
, 0x020304u
};
50 assert (s
.f1
== 0&& s
.f2
== 0);