summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_trim.f90
blob: d57610cca5214637e2a8b8d6b16b49df218f0e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! Program to test the TRIM and REPEAT intrinsics.
program intrinsic_trim
  character(len=8) a
  character(len=4) b,work
  a='1234    '
  b=work(8,a)
  if (llt(b,"1234")) call abort()
  a='     '
  b=trim(a)
  if (b .gt. "") call abort()
  b='12'
  a=repeat(b,0)
  if (a .gt. "") call abort()
  a=repeat(b,2)
  if (a .ne. "12  12  ") call abort()
end

function work(i,a)
  integer i
  character(len=i) a
  character(len=4) work
  work = trim(a)
end