summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/string_pad_trunc.f90
blob: 738a181b962d350093b4da8134ef85c1521a3ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
! PR20713. Pad and truncate string.

character(len = 6),parameter:: a = 'hello'
character(len = 6),parameter:: b = 'hello *'
character(len = 6),parameter:: c (1:1) = 'hello'
character(len = 11) line

write (line, '(6A)') a, 'world'
if (line .ne. 'hello world') call abort

write (line, '(6A)') b, 'world'
if (line .ne. 'hello world') call abort

write (line, '(6A)') c, 'world'
if (line .ne. 'hello world') call abort

write (line, '(6A)') c(1), 'world'
if (line .ne. 'hello world') call abort
end