1! { dg-do run }
2! { dg-options "-fwhole-file -O3" }
3! Check that the TYPE_CANONICAL is being correctly set
4! for the derived types, when whole file compiling.
5! (based on import.f90)
6!
7subroutine test(x)
8  type myType3
9    sequence
10    integer :: i
11  end type myType3
12  type(myType3) :: x
13  if(x%i /= 7) call abort()
14  x%i = 1
15end subroutine test
16
17
18program foo
19  type myType3
20    sequence
21    integer :: i
22  end type myType3
23
24  type(myType3) :: z
25  z%i = 7
26  call test(z)
27  if(z%i /= 1) call abort
28end program foo
29