gcc/testsuite/gfortran.dg/pr102112.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! Contributed by Brad Richardson <[email protected]> |
| 4 | ! |
| 5 | program main |
| 6 | implicit none |
| 7 | |
| 8 | type :: sub_t |
| 9 | integer :: val |
| 10 | end type |
| 11 | |
| 12 | type :: obj_t |
| 13 | type(sub_t) :: sub_obj |
| 14 | end type |
| 15 | |
| 16 | associate(initial_sub => sub_t(42)) |
| 17 | associate(obj => obj_t(initial_sub)) |
| 18 | associate(sub_obj => obj%sub_obj) |
| 19 | if (sub_obj%val .ne. 42) stop 1 |
| 20 | end associate |
| 21 | end associate |
| 22 | end associate |
| 23 | end program |