Lines Matching +full:set +full:- +full:env

1 /*-
28 * Test the correctness and C99-compliance of various fenv.h features.
44 #include "test-utils.h"
56 /* init_exceptsets() initializes this to the power set of std_excepts[] */
62 * Initialize std_except_sets[] to the power set of std_excepts[]
74 std_except_sets[i] |= std_excepts[j] & ((~sr & 1) - 1); in do_setup()
79 * Raise a floating-point exception without relying on the standard
121 * or a floating-point instruction to get synchronous exceptions. in raiseexcept()
137 * This test works just as well with 0.0 - 0.0, except on ia64 in getround()
138 * where 0.0 - 0.0 gives the wrong sign when rounding downwards. in getround()
141 d -= 1.0; in getround()
165 * could be multiple machine-specific default environments.
171 fenv_t env; in ATF_TC_BODY() local
173 fegetenv(&env); in ATF_TC_BODY()
175 hexdump(&env, sizeof(env), "current fenv ", HD_OMIT_CHARS); in ATF_TC_BODY()
176 hexdump(FE_DFL_ENV, sizeof(env), "default fenv ", HD_OMIT_CHARS); in ATF_TC_BODY()
181 * set once fnstenv returns. in ATF_TC_BODY()
184 * by zero'ing out the env.__x87.__other field (example: AMD Opteron in ATF_TC_BODY()
186 * env.__x87.__other field will contain after fnstenv is executed, so in ATF_TC_BODY()
187 * the values in env.__x87.__other could be filled with arbitrary in ATF_TC_BODY()
193 ATF_CHECK(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr, in ATF_TC_BODY()
194 sizeof(env.__mxcsr)) == 0); in ATF_TC_BODY()
195 ATF_CHECK(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control, in ATF_TC_BODY()
196 sizeof(env.__x87.__control)) == 0); in ATF_TC_BODY()
197 ATF_CHECK(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status, in ATF_TC_BODY()
198 sizeof(env.__x87.__status)) == 0); in ATF_TC_BODY()
199 ATF_CHECK(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag, in ATF_TC_BODY()
200 sizeof(env.__x87.__tag)) == 0); in ATF_TC_BODY()
202 ATF_CHECK_EQ(0, memcmp(&env, FE_DFL_ENV, sizeof(env))); in ATF_TC_BODY()
222 /* FE_ALL_EXCEPT might be special-cased, as on i386. */ in ATF_TC_BODY()
372 * Some platforms like powerpc may set extra exception bits. Since in ATF_TC_BODY()
412 "set to trap: %#x vs %#x", except, ALL_STD_EXCEPT); in ATF_TC_BODY()
439 * a floating-point exception. in ATF_TC_BODY()
470 case -1: /* error */ in ATF_TC_BODY()
487 fenv_t env; in ATF_TC_BODY() local
508 * a floating-point exception. in ATF_TC_BODY()
521 ATF_CHECK_EQ(0, feholdexcept(&env)); in ATF_TC_BODY()
528 ATF_CHECK_EQ(0, feupdateenv(&env)); in ATF_TC_BODY()
544 case -1: /* error */ in ATF_TC_BODY()