| 1 |
! REPEAT intrinsic, test for PR 31304 |
| 2 |
! We check that REPEAT accepts all kind arguments for NCOPIES |
| 3 |
! |
| 4 |
! { dg-do run } |
| 5 |
program test |
| 6 |
implicit none |
| 7 |
|
| 8 |
integer(kind=1) i1 |
| 9 |
integer(kind=2) i2 |
| 10 |
integer(kind=4) i4 |
| 11 |
integer(kind=4) i8 |
| 12 |
real(kind=8) r |
| 13 |
character(len=2) s1, s2 |
| 14 |
|
| 15 |
i1 = 1 ; i2 = 1 ; i4 = 1 ; i8 = 1 |
| 16 |
r = 1 |
| 17 |
s1 = '42' |
| 18 |
r = nearest(r,r) |
| 19 |
|
| 20 |
s2 = repeat(s1,i1) |
| 21 |
if (s2 /= s1) STOP 1 |
| 22 |
s2 = repeat(s1,i2) |
| 23 |
if (s2 /= s1) STOP 2 |
| 24 |
s2 = repeat(s1,i4) |
| 25 |
if (s2 /= s1) STOP 3 |
| 26 |
s2 = repeat(s1,i8) |
| 27 |
if (s2 /= s1) STOP 4 |
| 28 |
|
| 29 |
end program test |