aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/reassoc_3.f90
blob: ac2f6aacf0820a4a6120d0c6832773bea748c7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
! { dg-options "-O -ffast-math -fdump-tree-original -fdump-tree-optimized" }

! Verify we associate properly during folding
! Verify we propagate constants in the presence of PAREN_EXPR

function test(a)
  real b, c, d
  c = a
  d = 5
  b = (c + 5 - c)
  b = (c + d - c)
  test = a + b - 5
end

! { dg-final { scan-tree-dump "b = 5" "original" } }
! { dg-final { scan-tree-dump-times " = " 1 "optimized" } }