comparison gcc/testsuite/gfortran.dg/data_initialized_3.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 ! { dg-do compile }
2 !
3 ! PR fortran/65532
4 ! The partial initialization through data statements was producing
5 ! shape mismatch errors.
6 !
7 ! Contributed by Harald Anlauf <anlauf@gmx.de>
8
9 module gfcbug131
10 implicit none
11 contains
12 DOUBLE PRECISION FUNCTION d1mach(i)
13 INTEGER, INTENT(IN) :: i
14
15 INTEGER :: small(4)
16 INTEGER :: large(4)
17 INTEGER :: right(4)
18 INTEGER :: diver(4)
19 INTEGER :: LOG10(4)
20 DOUBLE PRECISION :: dmach(5)
21
22 EQUIVALENCE (dmach(1),small(1))
23 EQUIVALENCE (dmach(2),large(1))
24 EQUIVALENCE (dmach(3),right(1))
25 EQUIVALENCE (dmach(4),diver(1))
26 EQUIVALENCE (dmach(5),LOG10(1))
27
28 DATA small(1),small(2) / 0, 1048576 /
29 DATA large(1),large(2) / -1, 2146435071 /
30 DATA right(1),right(2) / 0, 1017118720 /
31 DATA diver(1),diver(2) / 0, 1018167296 /
32 DATA LOG10(1),LOG10(2) / 1352628735, 1070810131 /
33
34 d1mach = dmach(i)
35 END FUNCTION d1mach
36
37 DOUBLE PRECISION FUNCTION foo (x)
38 DOUBLE PRECISION, INTENT(IN) :: x
39 foo = SQRT (d1mach(4))
40 END FUNCTION foo
41
42 end module gfcbug131
43