]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport from mainline
authorUros Bizjak <ubizjak@gmail.com>
Wed, 1 Oct 2014 16:57:15 +0000 (18:57 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 1 Oct 2014 16:57:15 +0000 (18:57 +0200)
2013-11-07  Joseph Myers  <joseph@codesourcery.com>

* lib/target-supports.exp
(check_effective_target_fenv_exceptions): New function.

From-SVN: r215769

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index 7bcdf7a9e00a19c21854d4110f1eb71192c80f20..e06517d20eabdd0e207f6a65f7f54a38b1f16fad 100644 (file)
@@ -1,3 +1,11 @@
+2014-10-01  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2013-11-07  Joseph Myers  <joseph@codesourcery.com>
+
+       * lib/target-supports.exp
+       (check_effective_target_fenv_exceptions): New function.
+
 2014-09-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR inline-asm/63282
index a76968202c84204e5e21af82342afc709af15135..d4bda1f8767cba577f2cfbaf94a0857543de81c0 100644 (file)
@@ -5338,3 +5338,40 @@ proc check_effective_target_aarch64_large { } {
        return 0
     }
 }
+
+# Return 1 if <fenv.h> is available with all the standard IEEE
+# exceptions and floating-point exceptions are raised by arithmetic
+# operations.  (If the target requires special options for "inexact"
+# exceptions, those need to be specified in the testcases.)
+
+proc check_effective_target_fenv_exceptions {} {
+    return [check_runtime fenv_exceptions {
+       #include <fenv.h>
+       #include <stdlib.h>
+       #ifndef FE_DIVBYZERO
+       # error Missing FE_DIVBYZERO
+       #endif
+       #ifndef FE_INEXACT
+       # error Missing FE_INEXACT
+       #endif
+       #ifndef FE_INVALID
+       # error Missing FE_INVALID
+       #endif
+       #ifndef FE_OVERFLOW
+       # error Missing FE_OVERFLOW
+       #endif
+       #ifndef FE_UNDERFLOW
+       # error Missing FE_UNDERFLOW
+       #endif
+       volatile float a = 0.0f, r;
+       int
+       main (void)
+       {
+         r = a / a;
+         if (fetestexcept (FE_INVALID))
+           exit (0);
+         else
+           abort ();
+       }
+    } [add_options_for_ieee "-std=gnu99"]]
+}