Fix test-fexcept when "inexact" implicitly raised.
commit98dac0ce7641cb081f696cc80a22be7af6d62caa
authorJoseph Myers <joseph@codesourcery.com>
Fri, 12 Aug 2016 17:34:01 +0000 (12 17:34 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 12 Aug 2016 17:34:01 +0000 (12 17:34 +0000)
treefa48db9cb2d460565bb7a742f6ac35a6958fd508
parentab70f211651f50622d7f8afe3f6a68c472b1fb5a
Fix test-fexcept when "inexact" implicitly raised.

ISO C allows feraiseexcept to raise "inexact", in addition to the
requested exceptions, when requested to raise "overflow" or
"underflow".  Testing on ARM and PowerPC e500 (where glibc's
feraiseexcept has this property) showed that the new test-fexcept test
failed to allow for this; this patch fixes it, by wrapping
feraiseexcept to clear FE_INEXACT if implicitly raised and not raised
before the call.  (It would also be possible to do this with
fesetexcept, which always affects exactly the requested flags, but
this patch avoids making this fix depend on the fesetexcept changes.)

Tested for x86_64, x86, arm and e500.

* math/test-fexcept.c (feraiseexcept_exact): New function.
(test_set): Call feraiseexcept_exact instead of feraiseexcept.
(test_except): Likewise.
ChangeLog
math/test-fexcept.c