1! { dg-do run }
2! Test the fix for PR47519, in which the character length was not
3! calculated for the SOURCE expressions below and an ICE resulted. 
4!
5! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
6!
7program note7_35
8   implicit none
9   character(:), allocatable :: name
10   character(:), allocatable :: src
11   integer n
12   n = 10
13   allocate(name, SOURCE=repeat('x',n))
14   if (name .ne. 'xxxxxxxxxx') call abort
15   if (len (name) .ne. 10 ) call abort
16   deallocate(name)
17   src = 'xyxy'
18   allocate(name, SOURCE=repeat(src,n))
19   if (name(37:40) .ne. 'xyxy') call abort
20   if (len (name) .ne. 40 ) call abort
21end program note7_35
22