]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Fix test-fenv.c feupdateenv tests
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Jan 2024 19:40:33 +0000 (16:40 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 10 Jan 2024 11:55:17 +0000 (08:55 -0300)
The feupdateenv tests added by 802aef27b2 do not restore the floating
point mask, which might keep some floating point exception enabled and
thus make the feupdateenv_single_test raise an unexpected signal.

Checked on x86_64-linux-gnu and aarch64-linux-gnu (on Apple M1 trapping
is supported).
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
math/test-fenv.c

index 9db6789e64b475ec11bc052ec2817f9e7f451451..8d39181b14d9dba991f541f0132ed90d1539644c 100644 (file)
@@ -659,6 +659,7 @@ static void
 feupdate_single_test (const char *flag_name, int fe_exc)
 {
   feenv_nomask_test (flag_name, fe_exc, feupdateenv);
+  fesetenv (FE_DFL_ENV);
   feenv_mask_test (flag_name, fe_exc, feupdateenv);
 }
 #endif