1  /* { dg-do compile } */ 
       2  /* { dg-options "-O2 -fdump-tree-sink-stats" } */
       3  extern int foo (int *, int *);
       4  extern int foo2 (int);
       5  int
       6  main (int argc)
       7  {
       8    int a, b, c;
       9    b = argc + 1;
      10    c = argc + 2;
      11    a = b + c;
      12    if (argc)
      13      {
      14        foo (&b, &c);
      15        a = b + c;
      16      }
      17    foo2 (a);
      18  }
      19  /* We should sink the first a = b + c calculation into the else branch  */
      20  /* { dg-final { scan-tree-dump-times "Sunk statements: 1" 1 "sink1" } } */