From: Uros Bizjak Date: Wed, 1 Oct 2014 16:57:15 +0000 (+0200) Subject: Backport from mainline X-Git-Tag: releases/gcc-4.8.4~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=651de0f23c09c391b68b27f140708130bdfd5ce9;p=thirdparty%2Fgcc.git Backport from mainline 2013-11-07 Joseph Myers * lib/target-supports.exp (check_effective_target_fenv_exceptions): New function. From-SVN: r215769 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bcdf7a9e00a..e06517d20eab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-10-01 Uros Bizjak + + Backport from mainline + 2013-11-07 Joseph Myers + + * lib/target-supports.exp + (check_effective_target_fenv_exceptions): New function. + 2014-09-30 Jakub Jelinek PR inline-asm/63282 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index a76968202c84..d4bda1f8767c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5338,3 +5338,40 @@ proc check_effective_target_aarch64_large { } { return 0 } } + +# Return 1 if 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 + #include + #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"]] +}