Debian Codegraph @

gcc/testsuite/gfortran.dg/allocate_with_source_27.f90

raw
1 !
2 ! { dg-do run }
3 !
4 ! fortran/PR114024
5 ! https://github.com/fujitsu/compiler-test-suite
6 ! Modified from Fortran/0093/0093_0130.f90
7 !
8 program foo
9 implicit none
10 complex :: cmp(3)
11 real, allocatable :: xx(:), yy(:), zz(:)
12 cmp = (3., 6.78)
13 allocate(xx, source = cmp%re) ! This caused an ICE.
14 allocate(yy, source = cmp(1:3)%re) ! This caused an ICE.
15 allocate(zz, source = (cmp%re))
16 if (any(xx /= [3., 3., 3.])) stop 1
17 if (any(yy /= [3., 3., 3.])) stop 2
18 if (any(zz /= [3., 3., 3.])) stop 3
19 end program foo
20