[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / math / in_float_range_test_helper.h
blob5f345c0cf17af0bc315443a91f6ce1dca87f025a
1 //
2 // Created by kirill on 8/30/22.
3 //
5 #ifndef LLVM_IN_FLOAT_RANGE_TEST_HELPER_H
6 #define LLVM_IN_FLOAT_RANGE_TEST_HELPER_H
8 #include <stdint.h>
10 #define CHECK_DATA(start, stop, mfp_op, f, f_check, count, prec) \
11 { \
12 uint64_t ustart = FPBits(start).uintval(); \
13 uint64_t ustop = FPBits(stop).uintval(); \
14 for (uint64_t i = 0;; ++i) { \
15 uint64_t v = ustart + (ustop - ustart) * i / count; \
16 if (v > ustop) \
17 break; \
18 float x = FPBits(uint32_t(v)).get_val(); \
19 if ((f_check)(x)) { \
20 EXPECT_MPFR_MATCH_ALL_ROUNDING(mfp_op, x, static_cast<float>((f)(x)), \
21 (prec)); \
22 } \
23 } \
26 #endif // LLVM_IN_FLOAT_RANGE_TEST_HELPER_H