From: Eric Botcazou Date: Mon, 22 Dec 2014 11:05:18 +0000 (+0000) Subject: * gnat.dg/nan_max.adb: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d3a0146ae9b32c4c57cbd4d5cde2672ed283828;p=gcc.git * gnat.dg/nan_max.adb: New test. From-SVN: r219011 --- diff --git a/gcc/testsuite/gnat.dg/nan_max.adb b/gcc/testsuite/gnat.dg/nan_max.adb new file mode 100644 index 00000000000..a2cac30f5e8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/nan_max.adb @@ -0,0 +1,30 @@ +-- { dg-do run } + +procedure Nan_Max is + + function NaN return Long_Float is + Zero : Long_Float := 0.0; + begin + return Zero / Zero; + end; + + Z : Long_Float := 1.0; + N : Long_Float := NaN; + +begin + if Long_Float'Max (N, Z) /= Z then + raise Program_Error; + end if; + + if Long_Float'Max (Z, N) /= Z then + raise Program_Error; + end if; + + if Long_Float'Max (NaN, Z) /= Z then + raise Program_Error; + end if; + + if Long_Float'Max (Z, NaN) /= Z then + raise Program_Error; + end if; +end;