gcc/testsuite/gfortran.dg/whole_file_35.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR fortran/50408 |
| 4 | ! |
| 5 | ! Contributed by Vittorio Zecca |
| 6 | ! |
| 7 | module m |
| 8 | type int |
| 9 | integer :: val |
| 10 | end type int |
| 11 | interface ichar |
| 12 | module procedure uch |
| 13 | end interface |
| 14 | contains |
| 15 | function uch (c) |
| 16 | character (len=1), intent (in) :: c |
| 17 | type (int) :: uch |
| 18 | intrinsic ichar |
| 19 | uch%val = 127 - ichar (c) |
| 20 | end function uch |
| 21 | end module m |
| 22 | |
| 23 | program p |
| 24 | use m |
| 25 | print *,ichar('~') ! must print "1" |
| 26 | end program p |