| 1 |
! { dg-do run } |
| 2 |
|
| 3 |
program selected |
| 4 |
implicit none |
| 5 |
|
| 6 |
integer, parameter :: k = max(1, selected_logical_kind(128)) |
| 7 |
logical(kind=k) :: l |
| 8 |
|
| 9 |
! This makes assumptions about the targets, but they are true |
| 10 |
! for all targets that gfortran supports |
| 11 |
|
| 12 |
if (selected_logical_kind(1) /= 1) STOP 1 |
| 13 |
if (selected_logical_kind(8) /= 1) STOP 2 |
| 14 |
if (selected_logical_kind(9) /= 2) STOP 3 |
| 15 |
if (selected_logical_kind(16) /= 2) STOP 4 |
| 16 |
if (selected_logical_kind(17) /= 4) STOP 5 |
| 17 |
if (selected_logical_kind(32) /= 4) STOP 6 |
| 18 |
if (selected_logical_kind(33) /= 8) STOP 7 |
| 19 |
if (selected_logical_kind(64) /= 8) STOP 8 |
| 20 |
|
| 21 |
! This should not exist |
| 22 |
|
| 23 |
if (selected_logical_kind(17921) /= -1) STOP 9 |
| 24 |
|
| 25 |
! We test for a kind larger than 64 bits separately |
| 26 |
|
| 27 |
if (storage_size(l) /= 8 * k) STOP 10 |
| 28 |
|
| 29 |
end program |