PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-20.c
blob6361b679c44b9684a2ead6bf47c487ad2574e552
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
4 double pcheck;
6 void foo(int n, int m, int b)
8 int i, j;
10 goto bb18;
12 start:
13 i = 1;
14 do {
15 j = 1;
16 do {
17 double x = pcheck;
18 x = x + 1;
19 pcheck = x;
20 j = j + 1;
21 } while (j != m);
22 i = i + 1;
23 } while (i != n);
25 bb18:
26 pcheck = 0.0;
27 goto start;
30 /* We should have inserted two PHI nodes and the one in the i-loop
31 should have 0.0 in the argument coming from the bb18 block. */
33 /* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */
34 /* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */
35 /* { dg-final { cleanup-tree-dump "pre" } } */