2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-sink-4.c
blob784edd2fc878dd60f19eabe9070ce35e331bd261
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)
8 int a, b, c;
9 b = argc + 1;
10 c = argc + 2;
11 a = b + c;
12 if (argc)
14 foo (&b, &c);
15 a = b + c;
17 foo2 (a);
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 "sink" } } */