From: Eric Botcazou Date: Mon, 22 Dec 2014 11:05:18 +0000 (+0000) Subject: * gnat.dg/nan_max.adb: New test. X-Git-Tag: releases/gcc-5.1.0~2194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d3a0146ae9b32c4c57cbd4d5cde2672ed283828;p=thirdparty%2Fgcc.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 000000000000..a2cac30f5e89 --- /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;