| 1 |
! { dg-do run } |
| 2 |
program foo |
| 3 |
|
| 4 |
use ieee_arithmetic |
| 5 |
|
| 6 |
implicit none |
| 7 |
|
| 8 |
call test04 |
| 9 |
call test08 |
| 10 |
call test10 |
| 11 |
call test16 |
| 12 |
|
| 13 |
contains |
| 14 |
|
| 15 |
subroutine test04 |
| 16 |
real(4) x, y |
| 17 |
if (ieee_support_subnormal(x)) then |
| 18 |
x = ieee_value(x, ieee_positive_subnormal) |
| 19 |
y = ieee_value(y, ieee_positive_denormal) |
| 20 |
if (x /= y) stop 1 |
| 21 |
x = ieee_value(x, ieee_negative_subnormal) |
| 22 |
y = ieee_value(y, ieee_negative_denormal) |
| 23 |
if (x /= y) stop 2 |
| 24 |
end if |
| 25 |
end subroutine test04 |
| 26 |
|
| 27 |
subroutine test08 |
| 28 |
real(8) x, y |
| 29 |
if (ieee_support_subnormal(x)) then |
| 30 |
x = ieee_value(x, ieee_positive_subnormal) |
| 31 |
y = ieee_value(y, ieee_positive_denormal) |
| 32 |
if (x /= y) stop 1 |
| 33 |
x = ieee_value(x, ieee_negative_subnormal) |
| 34 |
y = ieee_value(y, ieee_negative_denormal) |
| 35 |
if (x /= y) stop 2 |
| 36 |
end if |
| 37 |
end subroutine test08 |
| 38 |
|
| 39 |
#ifdef __GFC_REAL_10__ |
| 40 |
subroutine test10 |
| 41 |
real(10) x, y |
| 42 |
if (ieee_support_subnormal(x)) then |
| 43 |
x = ieee_value(x, ieee_positive_subnormal) |
| 44 |
y = ieee_value(y, ieee_positive_denormal) |
| 45 |
if (x /= y) stop 1 |
| 46 |
x = ieee_value(x, ieee_negative_subnormal) |
| 47 |
y = ieee_value(y, ieee_negative_denormal) |
| 48 |
if (x /= y) stop 2 |
| 49 |
end if |
| 50 |
end subroutine test10 |
| 51 |
#else |
| 52 |
subroutine test10 |
| 53 |
end subroutine test10 |
| 54 |
#endif |
| 55 |
|
| 56 |
#ifdef __GFC_REAL_16__ |
| 57 |
subroutine test16 |
| 58 |
real(16) x, y |
| 59 |
if (ieee_support_subnormal(x)) then |
| 60 |
x = ieee_value(x, ieee_positive_subnormal) |
| 61 |
y = ieee_value(y, ieee_positive_denormal) |
| 62 |
if (x /= y) stop 1 |
| 63 |
x = ieee_value(x, ieee_negative_subnormal) |
| 64 |
y = ieee_value(y, ieee_negative_denormal) |
| 65 |
if (x /= y) stop 2 |
| 66 |
end if |
| 67 |
end subroutine test16 |
| 68 |
#else |
| 69 |
subroutine test16 |
| 70 |
end subroutine test16 |
| 71 |
#endif |
| 72 |
|
| 73 |
|
| 74 |
end program foo |