2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / assignment_3.f90
blobd843c3200cb9a5a1fe537ace195bed68167150a1
1 ! { dg-do compile }
2 ! PR fortran/36316
4 ! gfortran generated a mismatching tree ("type mismatch in binary expression")
5 ! for array bounds (mixing integer kind=4/kind=8 without fold_convert).
7 MODULE YOMCAIN
9 IMPLICIT NONE
10 SAVE
12 TYPE distributed_vector
13 REAL, pointer :: local(:)
14 INTEGER(4) :: global_length,local_start
15 INTEGER(8) :: local_end
16 END TYPE distributed_vector
18 INTERFACE ASSIGNMENT (=)
19 MODULE PROCEDURE assign_ar_dv
20 END INTERFACE
22 INTERFACE OPERATOR (*)
23 MODULE PROCEDURE multiply_dv_dv
24 END INTERFACE
26 CONTAINS
28 SUBROUTINE assign_ar_dv (handle,pvec)
30 ! copy array to the distributed_vector
32 REAL, INTENT(IN) :: pvec(:)
33 TYPE (distributed_vector), INTENT(INOUT) :: handle
35 handle%local(:) = pvec(:)
37 RETURN
38 END SUBROUTINE assign_ar_dv
40 FUNCTION multiply_dv_dv (handle1,handle2)
42 ! multiply two distributed_vectors
44 TYPE (distributed_vector), INTENT(IN) :: handle2
45 TYPE (distributed_vector), INTENT(IN) :: handle1
46 REAL :: multiply_dv_dv(handle1%local_start:handle1%local_end)
48 multiply_dv_dv = handle1%local(:) * handle2%local(:)
50 RETURN
51 END FUNCTION multiply_dv_dv
54 SUBROUTINE CAININAD_SCALE_DISTVEC ()
55 TYPE (distributed_vector) :: PVAZG
56 TYPE (distributed_vector) :: ZTEMP
57 TYPE (distributed_vector) :: SCALP_DV
59 ZTEMP = PVAZG * SCALP_DV
60 END SUBROUTINE CAININAD_SCALE_DISTVEC
61 END MODULE YOMCAIN