1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-tailc-details" } */
3 /* Test provided by Richard Earnshaw in PR 14312.  */
4 
5 void bar (int i);
6 void baz (int *);
7 
8 void
foo(int * x)9 foo (int *x)
10 {
11   if (*x < 0)
12     {
13       baz (x);
14       return;
15     }
16   bar (*x);
17 }
18 
19 /* The test has no local call-clobbered variables.  Only the memory
20    tag for 'x' is call-clobbered.  And since tags are not real
21    variables, they ought to be ignored.  There should be two tail
22    calls here.  */
23 /* { dg-final { scan-tree-dump-times "Found tail call" 2 "tailc"} } */
24