tree-optimization/113385 - wrong loop father with early exit vectorization
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_31.f03
blob708c94542179467ae8d26682b7eeec1e9a850e32
1 ! { dg-do run }
3 ! Test the fix for PR100110, in which 'obj' was not being initialized.
5 ! Contributed by Xiao Liu  <xiao.liu@compiler-dev.com>
7 program p
8   implicit none
9   type t(n)
10     integer, len :: n
11     integer :: arr(n, n)
12   end type
14   type(t(2)) :: obj
16   obj%arr = reshape ([1,2,3,4],[2,2])
17   if (obj%n .ne. 2) stop 1
18   if (any (shape(obj%arr) .ne. [2,2])) stop 2
19   call test()
20 contains
21   subroutine test()
22     if (obj%n .ne. 2) stop 3
23     if (any (shape(obj%arr) .ne. [2,2])) stop 4
24     if (any (reshape (obj%arr, [4]) .ne. [1,2,3,4])) stop 5
25   end subroutine
26 end program