| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Check for the new Fortran 2023 ISO_FORTRAN_ENV named constants |
| 4 |
|
| 5 |
program test |
| 6 |
use iso_fortran_env |
| 7 |
implicit none |
| 8 |
|
| 9 |
! These integer kinds are guaranteed on |
| 10 |
integer(int8) :: i8 |
| 11 |
integer(int16) :: i16 |
| 12 |
integer(int32) :: i32 |
| 13 |
integer(int64) :: i64 |
| 14 |
|
| 15 |
logical(logical8) :: l8 |
| 16 |
logical(logical16) :: l16 |
| 17 |
logical(logical32) :: l32 |
| 18 |
logical(logical64) :: l64 |
| 19 |
|
| 20 |
! We do not support REAL16 for now, but check it can |
| 21 |
! still be used in specification expressions |
| 22 |
real(kind=max(real16, real32)) :: x |
| 23 |
|
| 24 |
if (logical8 /= int8) stop 1 |
| 25 |
if (logical16 /= int16) stop 2 |
| 26 |
if (logical32 /= int32) stop 3 |
| 27 |
if (logical64 /= int64) stop 4 |
| 28 |
|
| 29 |
! We do not support REAL16 for now |
| 30 |
if (real16 /= -2) stop 101 |
| 31 |
|
| 32 |
end program test |