re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / elemental_dependency_6.f90
blob74739d84637555bbe4d57f82ddafa055ba2073cc
1 ! { dg-do run }
3 ! PR fortran/66089
4 ! Check that we do create a temporary for C(1) below in the assignment
5 ! to C.
7 type :: t
8 integer :: c
9 end type t
11 type(t), dimension(5) :: b, c
13 b = t(7)
14 c = t(13)
15 c = plus(c(1), b)
16 ! print *, c
17 if (any(c%c /= 20)) STOP 1
19 contains
21 elemental function plus(lhs, rhs)
22 type(t), intent(in) :: lhs, rhs
23 type(t) :: plus
24 plus%c = lhs%c + rhs%c
25 end function plus
27 end