diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/expr.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/ieee/ieee_11.F90 | 74 |
4 files changed, 84 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e260028..30a7c0f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> + * expr.c (external_spec_function): Add ieee_support_subnormal to list + of IEEE inquiry functions. + +2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> + * cpp.c (gfc_cpp_init): Add pre-defined macros for INTEGER(1) INTEGER(2), INTEGER(8) and INTEGER(16) if supported. Add pre-defined macros for REAL(10) and REAL(16) if available. diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 638b38d..aad1496 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3068,6 +3068,7 @@ external_spec_function (gfc_expr *e) || !strcmp (f->name, "ieee_support_halting") || !strcmp (f->name, "ieee_support_datatype") || !strcmp (f->name, "ieee_support_denormal") + || !strcmp (f->name, "ieee_support_subnormal") || !strcmp (f->name, "ieee_support_divide") || !strcmp (f->name, "ieee_support_inf") || !strcmp (f->name, "ieee_support_io") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cdfc940..5e9bd88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-12-29 Steven G. Kargl <kargl@gcc.gnu.org> + + * gfortran.dg/ieee/ieee_11.F90: New test. + 2018-12-29 Jozef Lawrynowicz <jozef.l@mittosystems.com> * gcc.target/msp430/critical-interrupt.c: New test. diff --git a/gcc/testsuite/gfortran.dg/ieee/ieee_11.F90 b/gcc/testsuite/gfortran.dg/ieee/ieee_11.F90 new file mode 100644 index 0000000..9f62e70 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/ieee/ieee_11.F90 @@ -0,0 +1,74 @@ +! { dg-do run } +program foo + + use ieee_arithmetic + + implicit none + + call test04 + call test08 + call test10 + call test16 + + contains + + subroutine test04 + real(4) x, y + if (ieee_support_subnormal(x)) then + x = ieee_value(x, ieee_positive_subnormal) + y = ieee_value(y, ieee_positive_denormal) + if (x /= y) stop 1 + x = ieee_value(x, ieee_negative_subnormal) + y = ieee_value(y, ieee_negative_denormal) + if (x /= y) stop 2 + end if + end subroutine test04 + + subroutine test08 + real(8) x, y + if (ieee_support_subnormal(x)) then + x = ieee_value(x, ieee_positive_subnormal) + y = ieee_value(y, ieee_positive_denormal) + if (x /= y) stop 1 + x = ieee_value(x, ieee_negative_subnormal) + y = ieee_value(y, ieee_negative_denormal) + if (x /= y) stop 2 + end if + end subroutine test08 + +#ifdef __GFC_REAL_10__ + subroutine test10 + real(10) x, y + if (ieee_support_subnormal(x)) then + x = ieee_value(x, ieee_positive_subnormal) + y = ieee_value(y, ieee_positive_denormal) + if (x /= y) stop 1 + x = ieee_value(x, ieee_negative_subnormal) + y = ieee_value(y, ieee_negative_denormal) + if (x /= y) stop 2 + end if + end subroutine test10 +#else + subroutine test10 + end subroutine test10 +#endif + +#ifdef __GFC_REAL_16__ + subroutine test16 + real(16) x, y + if (ieee_support_subnormal(x)) then + x = ieee_value(x, ieee_positive_subnormal) + y = ieee_value(y, ieee_positive_denormal) + if (x /= y) stop 1 + x = ieee_value(x, ieee_negative_subnormal) + y = ieee_value(y, ieee_negative_denormal) + if (x /= y) stop 2 + end if + end subroutine test16 +#else + subroutine test16 + end subroutine test16 +#endif + + +end program foo |