2 ! { dg-options "-ffrontend-optimize -faggressive-function-elimination -finline-matmul-limit=0 -Wfunction-elimination" }
3 ! Check the -ffrontend-optimize (in the absence of -O) and
4 ! -Wfunction-elimination options.
7 real, dimension(2,2) :: a
, b
, c
, d
11 real, external :: ext_func
13 elemental
function element(x
)
17 pure
function mypure(x
)
21 elemental impure
function elem_impure(x
)
24 end function elem_impure
27 data a
/2., 3., 5., 7./
28 data b
/11., 13., 17., 23./
29 write (unit
=line
, fmt
='(4F7.2)') matmul(a
,b
) &
31 z
= sin(x
) + 2.0 + sin(x
)
33 x
= ext_func(a
) + 23 + ext_func(a
) ! { dg-warning "Removing call to impure function" }
35 z
= element(x
) + element(x
)
37 i
= mypure(x
) - mypure(x
)
39 z
= elem_impure(x
) - elem_impure(x
) ! { dg-warning "Removing call to impure function" }