1 /* { dg-do run { target trampolines } } */
2 /* { dg-options "-O2" } */
3 /* { dg-additional-sources "tailcall-7.c" } */
6 extern struct s global
;
11 struct s
g4 (struct s
);
15 struct s
g8 (struct s
*);
32 callit (void (*fn
) (void))
38 test (int last_val
, int global_val
, int tmp_val
)
40 return last
.x
== last_val
&& global
.x
== global_val
&& tmp
.x
== tmp_val
;
49 if (!test (101, 200, 300))
52 if (!test (102, 102, 300))
55 if (!test (103, 102, 103))
57 if (g4 (tmp
).x
!= 104 || !test (104, 102, 103))
59 if (g5 ().x
!= 105 || !test (105, 102, 103))
61 if (g6 ().x
!= 106 || !test (106, 102, 103))
63 if (g7 ().x
!= 107 || !test (107, 107, 103))
65 if (g8 (&tmp
).x
!= 108 || !test (108, 107, 108))
67 if (g9 (tmp
) != 9 || !test (109, 107, 108))
69 if (g10 (10) != 10 || !test (110, 107, 108))