modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_with_source_20.f03
blob243214bd9625760b7449c86fa22067deea43e670
1 ! { dg-do run }
3 ! Check that PR72698 is fixed.
4 ! Contributed by Gerhard Steinmetz
6 module m
7 contains
8    integer function f()
9       f = 4
10    end
11 end
12 program p
13    use m
14    character(3), parameter :: c = 'abc'
15    character(:), allocatable :: z
16    allocate (z, source=repeat(c(2:1), f()))
17    if (len(z) /= 0) STOP 1
18    if (z /= "") STOP 2
19 end