Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.dg / assign_func_dtcomp_1.f90
blob385eb2715f68e522d6083195ef354f70616cd0b5
1 ! { dg-do run }
2 ! { dg-options "-O0" }
4 ! Test fix for PR18022.
6 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
8 program assign_func_dtcomp
9 implicit none
10 type :: mytype
11 real :: x
12 real :: y
13 end type mytype
14 type (mytype), dimension (4) :: z
16 type :: thytype
17 real :: x(4)
18 end type thytype
19 type (thytype) :: w
20 real, dimension (4) :: a = (/1.,2.,3.,4./)
21 real, dimension (4) :: b = (/5.,6.,7.,8./)
24 ! Test the original problem is fixed.
25 z(:)%x = foo (a)
26 z(:)%y = foo (b)
29 if (any(z%x.ne.a).or.any(z%y.ne.b)) call abort ()
31 ! Make sure we did not break anything on the way.
32 w%x(:) = foo (b)
33 a = foo (b)
35 if (any(w%x.ne.b).or.any(a.ne.b)) call abort ()
37 contains
39 function foo (v) result (ans)
40 real, dimension (:), intent(in) :: v
41 real, dimension (size(v)) :: ans
42 ans = v
43 end function foo
46 end program assign_func_dtcomp