]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/tailcall-8-run.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / tailcall-8-run.c
CommitLineData
84db1406
RS
1/* { dg-do run } */
2/* { dg-options "-O2" } */
3/* { dg-additional-sources "tailcall-8.c" } */
4
5struct s { int x; };
6
7int expected;
8struct s *last_ptr;
9struct s tmp;
10
11void
12start (int val, struct s *initial_last_ptr)
13{
14 expected = val;
15 tmp.x = val;
16 last_ptr = initial_last_ptr;
17}
18
19void
20f_direct (struct s param)
21{
22 if (param.x != expected)
23 __builtin_abort ();
24}
25
26void
27f_indirect (struct s *ptr)
28{
29 if (ptr->x != expected)
30 __builtin_abort ();
31 last_ptr = ptr;
32 ptr->x += 100;
33}
34
35void
36f_void (void)
37{
38 if (last_ptr->x != expected + 100)
39 __builtin_abort ();
40}
41
42
43void g1 (struct s);
44void g2 (struct s *);
45void g3 (struct s *);
46void g4 (struct s *);
47void g5 (struct s);
48void g6 (struct s);
49void g7 (struct s);
50void g8 (struct s *);
51void g9 (struct s *);
52
53int
54main (void)
55{
56 struct s g6_s = { 106 };
57
58 start (1, 0);
59 g1 (tmp);
60
61 start (2, 0);
62 g2 (&tmp);
63
64 start (3, 0);
65 g3 (&tmp);
66
67 start (4, 0);
68 g4 (&tmp);
69
70 start (5, 0);
71 g5 (tmp);
72
73 start (6, &g6_s);
74 g6 (tmp);
75
76 start (7, 0);
77 g7 (tmp);
78
79 start (8, 0);
80 g8 (&tmp);
81
82 start (9, 0);
83 g9 (&tmp);
84
85 return 0;
86}