| 1 |
! { dg-do run } |
| 2 |
! PR31306 ICE with implicit character variables |
| 3 |
! Test case from PR and prepared by Jerry DeLisle <[email protected]> |
| 4 |
module cyclic |
| 5 |
implicit none |
| 6 |
contains |
| 7 |
character(10) function ouch(x,y) |
| 8 |
implicit character(len(ouch)) (x) |
| 9 |
implicit character(len(x)+1) (y) |
| 10 |
intent(in) x,y |
| 11 |
integer i |
| 12 |
do i = 1, len(ouch) |
| 13 |
ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) |
| 14 |
end do |
| 15 |
end function ouch |
| 16 |
end module cyclic |
| 17 |
|
| 18 |
program test |
| 19 |
use cyclic |
| 20 |
implicit none |
| 21 |
character(10) astr |
| 22 |
integer i |
| 23 |
write(astr,'(a)') ouch('YOW! ','jerry ') |
| 24 |
if (astr(1:5) /= "3*%SY") STOP 1 |
| 25 |
do i=6,10 |
| 26 |
if (astr(i:i) /= achar(0)) STOP 2 |
| 27 |
end do |
| 28 |
end program test |