2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / reassoc_3.f90
blob84a33972270cdb3a166d5205945a72a5e682c3c7
1 ! { dg-do compile }
2 ! { dg-options "-O -ffast-math -fdump-tree-original -fdump-tree-optimized" }
4 ! Verify we associate properly during folding
5 ! Verify we propagate constants in the presence of PAREN_EXPR
7 function test(a)
8 real b, c, d
9 c = a
10 d = 5
11 b = (c + 5 - c)
12 b = (c + d - c)
13 test = a + b - 5
14 end
16 ! { dg-final { scan-tree-dump "b = 5" "original" } }
17 ! { dg-final { scan-tree-dump "c_. = .a" "optimized" } }
18 ! { dg-final { scan-tree-dump "return c_.;" "optimized" } }
19 ! { dg-final { cleanup-tree-dump "original" } }
20 ! { dg-final { cleanup-tree-dump "optimized" } }