aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/function_optimize_4.f90
blob: 20fc46d3078b58931907e1bb9cc82f385101f372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
! { dg-options "-O" }
! PR 48412 - function elimination got temporary varibles in the wrong order.
! Test case contributed by Joost VandeVondele.

INTEGER FUNCTION S1(m,ma,lx)
INTEGER :: m,ma,lx

IF (((m < 0).AND.(MODULO(ABS(ma-lx),2) == 1)).OR.&
    ((m > 0).AND.(MODULO(ABS(ma-lx),2) == 0))) THEN
   S1=1
ELSE
   S1=0
ENDIF

END FUNCTION

INTEGER :: s1
IF (S1(1,2,1).NE.0) CALL ABORT()
END