From 1d3a0146ae9b32c4c57cbd4d5cde2672ed283828 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 22 Dec 2014 11:05:18 +0000 Subject: [PATCH] * gnat.dg/nan_max.adb: New test. From-SVN: r219011 --- gcc/testsuite/gnat.dg/nan_max.adb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gcc/testsuite/gnat.dg/nan_max.adb 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; -- 2.30.2