gcc/testsuite/gfortran.dg/pr94397.F90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | |
| 4 | module m |
| 5 | implicit none |
| 6 | contains |
| 7 | function is_real8(a) |
| 8 | class(*) :: a |
| 9 | logical :: is_real8 |
| 10 | is_real8 = .false. |
| 11 | select type(a) |
| 12 | type is(real(kind(1.0_8))) |
| 13 | is_real8 = .true. |
| 14 | end select |
| 15 | end function is_real8 |
| 16 | end module m |
| 17 | |
| 18 | program test |
| 19 | use m |
| 20 | |
| 21 | if (is_real8(1.0_4)) stop 1 |
| 22 | if (.not. is_real8(1.0_8)) stop 2 |
| 23 | #ifdef __GFC_REAL_16__ |
| 24 | if (is_real8(1.0_16)) stop 3 |
| 25 | #endif |
| 26 | end program |