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