]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/builtins/Unit/extendhfsf2_test.c
1 //===--------------- extendhfsf2_test.c - Test __extendhfsf2 --------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file tests __extendhfsf2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
18 float __extendhfsf2(uint16_t a
);
20 int test__extendhfsf2(uint16_t a
, float expected
)
22 float x
= __extendhfsf2(a
);
23 int ret
= compareResultH(x
, expected
);
26 printf("error in test__extendhfsf2(%#.4x) = %f, "
27 "expected %f\n", a
, x
, expected
);
32 char assumption_1
[sizeof(__fp16
) * CHAR_BIT
== 16] = {0};
37 if (test__extendhfsf2(UINT16_C(0x7e00),
41 if (test__extendhfsf2(UINT16_C(0x7e00),
42 makeNaN32(UINT32_C(0x8000))))
45 if (test__extendhfsf2(UINT16_C(0x7c00),
48 if (test__extendhfsf2(UINT16_C(0xfc00),
52 if (test__extendhfsf2(UINT16_C(0x0),
55 if (test__extendhfsf2(UINT16_C(0x8000),
59 if (test__extendhfsf2(UINT16_C(0x4248),
62 if (test__extendhfsf2(UINT16_C(0xc248),
65 if (test__extendhfsf2(UINT16_C(0x7c00),
66 0x1.987124876876324p
+100f
))
68 if (test__extendhfsf2(UINT16_C(0x6e62),
71 if (test__extendhfsf2(UINT16_C(0x3c00),
74 if (test__extendhfsf2(UINT16_C(0x0400),
78 if (test__extendhfsf2(UINT16_C(0x0010),
81 if (test__extendhfsf2(UINT16_C(0x0001),
84 if (test__extendhfsf2(UINT16_C(0x8001),
87 if (test__extendhfsf2(UINT16_C(0x0001),
91 if (test__extendhfsf2(UINT16_C(0x0000),
94 if (test__extendhfsf2(UINT16_C(0x8000),
98 if (test__extendhfsf2(UINT16_C(0x7bff),
102 if (test__extendhfsf2(UINT16_C(0x7bff),
106 if (test__extendhfsf2(UINT16_C(0x7c00),
109 if (test__extendhfsf2(UINT16_C(0xfc00),