2 ! { dg
-require
-effective
-target fortran_large_real
}
3 ! Tests the fix
for PR35944
/6/7, in which the variable array constructors below
4 ! were incorrectly translated and wrong code was produced
.
6 ! Contributed by Dick Hendrickson
<dick
.hendrickson@gmail
.com
>
9 call fa6013
(10, 1, -1)
10 call fa6077
(10, 1, -1, (/1,2,3,4,5,6,7,8,9,10/))
14 subroutine FA6013
(nf10
, nf1
, mf1
)
15 integer, parameter :: kv
= 4
18 REAL(KV
) DDA
(10), dval
19 dda
= (/1,2,3,4,5,6,7,8,9,10/)
20 DDA1
= ATAN2
((/(REAL(J1
,KV
),J1
=1,10)/),
21 $
REAL((/(J1
,J1
=nf10
,nf1
,mf1
)/), KV
)) !fails
22 DDA2
= ATAN2
(DDA
, DDA
(10:1:-1))
23 if (any
(DDA1
- DDA2
.gt
. epsilon
(dval
))) call abort
()
26 subroutine FA6077
(nf10
,nf1
,mf1
, ida
)
28 INTEGER IDA2
(10), ida
(10)
29 IDA1
= IEOR
((/1,2,3,4,5,6,7,8,9,10/),
30 $
(/(IDA
(J1
),J1
=10,1,-1)/) )
31 IDA2
= IEOR
((/1,2,3,4,5,6,7,8,9,10/), (/10,9,8,7,6,5,4,3,2,1/) )
32 if (any
(ida1
.ne
. ida2
)) call abort
()
38 parameter (k
=selected_real_kind
(precision (0.0_8
) + 1)) ! failed
41 qda
= (/ 1,2,3,4,5,6,7,8,9,10 /)
42 QDA1
= MOD
( 1.1_k*
( QDA
(1) -5.0_k
), P
=( QDA
-2.5_k
))
44 QVAL
= MOD
(1.1_k*
(QDA
(1)-5.0_k
),P
=(QDA
(J1
)-2.5_k
))
45 if (qval
- qda1
(j1
) .gt
. epsilon
(qval
)) call abort
()