gcc/testsuite/gfortran.dg/pr103389.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Contributed by Gerhard Steinmetz <[email protected]> |
| 4 | ! |
| 5 | program p |
| 6 | type t |
| 7 | integer, allocatable :: a(:) |
| 8 | end type |
| 9 | type(t) :: y |
| 10 | y%a = [1,2] |
| 11 | call s((y)) |
| 12 | if (any (y%a .ne. [3,4])) stop 1 |
| 13 | contains |
| 14 | subroutine s(x) |
| 15 | class(*) :: x |
| 16 | select type (x) |
| 17 | type is (t) |
| 18 | x%a = x%a + 2 |
| 19 | class default |
| 20 | stop 2 |
| 21 | end select |
| 22 | end |
| 23 | end |