aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2014-12-22 11:05:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-12-22 11:05:18 +0000
commit1d3a0146ae9b32c4c57cbd4d5cde2672ed283828 (patch)
treeb5f6d71a9785aab061034e1b50dcf727dba94ed4
parent881cdd61eef4cb4e4b907f571c60c41bdb7d43ed (diff)
downloadgcc-1d3a0146ae9b32c4c57cbd4d5cde2672ed283828.zip
gcc-1d3a0146ae9b32c4c57cbd4d5cde2672ed283828.tar.gz
gcc-1d3a0146ae9b32c4c57cbd4d5cde2672ed283828.tar.bz2
* gnat.dg/nan_max.adb: New test.
From-SVN: r219011
-rw-r--r--gcc/testsuite/gnat.dg/nan_max.adb30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/nan_max.adb b/gcc/testsuite/gnat.dg/nan_max.adb
new file mode 100644
index 0000000..a2cac30
--- /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;