summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/repeat_3.f90
blob: d571fc6e32a4fef58594c409bba4219574d38058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
! REPEAT intrinsic, test for PR 31304
! We check that REPEAT accepts all kind arguments for NCOPIES
!
! { dg-do run }
program test
  implicit none

  integer(kind=1) i1
  integer(kind=2) i2
  integer(kind=4) i4
  integer(kind=4) i8
  real(kind=8) r
  character(len=2) s1, s2

  i1 = 1 ; i2 = 1 ; i4 = 1 ; i8 = 1
  r = 1
  s1 = '42'
  r = nearest(r,r)

  s2 = repeat(s1,i1)
  if (s2 /= s1) call abort
  s2 = repeat(s1,i2)
  if (s2 /= s1) call abort
  s2 = repeat(s1,i4)
  if (s2 /= s1) call abort
  s2 = repeat(s1,i8)
  if (s2 /= s1) call abort

end program test