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