Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-29.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-details" } */
3
4 int flag, hoist, y, z;
5
6 void
7 foo (void)
8 {
9   if (flag)
10     y = hoist + 4;
11   else
12     flag = 888;
13   z = hoist + 4;
14   bark ();
15 }
16
17 /* We should see the partial redundancy of hoist + 4, not being confused
18    about bark () possibly clobbering hoist.  */
19
20 /* { dg-final { scan-tree-dump "Replaced hoist" "pre" } } */
21 /* { dg-final { cleanup-tree-dump "pre" } } */