Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / tailcall-8.c
blobffeabe54293605cdca3c036c951814e2d47f9763
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-tailc-details" } */
4 struct s { int x; };
5 void f_direct (struct s);
6 void f_indirect (struct s *);
7 void f_void (void);
9 /* Tail call. */
10 void
11 g1 (struct s param)
13 f_direct (param);
16 /* Tail call. */
17 void
18 g2 (struct s *param_ptr)
20 f_direct (*param_ptr);
23 /* Tail call. */
24 void
25 g3 (struct s *param_ptr)
27 f_indirect (param_ptr);
30 /* Tail call. */
31 void
32 g4 (struct s *param_ptr)
34 f_indirect (param_ptr);
35 f_void ();
38 /* Tail call. */
39 void
40 g5 (struct s param)
42 struct s local = param;
43 f_direct (local);
46 /* Tail call. */
47 void
48 g6 (struct s param)
50 struct s local = param;
51 f_direct (local);
52 f_void ();
55 /* Not a tail call. */
56 void
57 g7 (struct s param)
59 struct s local = param;
60 f_indirect (&local);
63 /* Not a tail call. */
64 void
65 g8 (struct s *param_ptr)
67 struct s local = *param_ptr;
68 f_indirect (&local);
71 /* Not a tail call. */
72 void
73 g9 (struct s *param_ptr)
75 struct s local = *param_ptr;
76 f_indirect (&local);
77 f_void ();
80 /* { dg-final { scan-tree-dump-times "Found tail call" 6 "tailc" } } */