gcc/testsuite/gfortran.dg/coarray/alloc_comp_10.f90
raw| 1 | !{ dg-do run } |
| 2 | |
| 3 | ! Check that copying of memory for allocated scalar is assigned |
| 4 | ! to coarray object. |
| 5 | |
| 6 | ! Contributed by G. Steinmetz <[email protected]> |
| 7 | |
| 8 | program p |
| 9 | type t |
| 10 | integer, allocatable :: a |
| 11 | end type |
| 12 | type t2 |
| 13 | type(t), allocatable :: b |
| 14 | end type |
| 15 | type(t2) :: x, y[*] |
| 16 | |
| 17 | x%b = t(1) |
| 18 | y = x |
| 19 | y%b%a = 2 |
| 20 | |
| 21 | if (x%b%a /= 1) stop 1 |
| 22 | if (y%b%a /= 2) stop 2 |
| 23 | end |
| 24 |