]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/builtins/Unit/extendsftf2_test.c
1 //===--------------- extendsftf2_test.c - Test __extendsftf2 --------------===//
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 __extendsftf2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
17 #if __LDBL_MANT_DIG__ == 113
21 COMPILER_RT_ABI
long double __extendsftf2(float a
);
23 int test__extendsftf2(float a
, uint64_t expectedHi
, uint64_t expectedLo
)
25 long double x
= __extendsftf2(a
);
26 int ret
= compareResultLD(x
, expectedHi
, expectedLo
);
30 printf("error in test__extendsftf2(%f) = %.20Lf, "
31 "expected %.20Lf\n", a
, x
, fromRep128(expectedHi
, expectedLo
));
36 char assumption_1
[sizeof(long double) * CHAR_BIT
== 128] = {0};
42 #if __LDBL_MANT_DIG__ == 113
44 if (test__extendsftf2(makeQNaN32(),
45 UINT64_C(0x7fff800000000000),
49 if (test__extendsftf2(makeNaN32(UINT32_C(0x410000)),
50 UINT64_C(0x7fff820000000000),
54 if (test__extendsftf2(makeInf32(),
55 UINT64_C(0x7fff000000000000),
59 if (test__extendsftf2(0.0f
, UINT64_C(0x0), UINT64_C(0x0)))
62 if (test__extendsftf2(0x1.23456p
+5f
,
63 UINT64_C(0x4004234560000000),
66 if (test__extendsftf2(0x1.edcbap
-9f
,
67 UINT64_C(0x3ff6edcba0000000),
70 if (test__extendsftf2(0x1.23456p
+45f
,
71 UINT64_C(0x402c234560000000),
74 if (test__extendsftf2(0x1.edcbap
-45f
,
75 UINT64_C(0x3fd2edcba0000000),