1 //===------------ netf2_test.c - Test __netf2------------------------------===//
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 __netf2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
16 #if __LP64__ && __LDBL_MANT_DIG__ == 113
20 int __netf2(long double a
, long double b
);
22 int test__netf2(long double a
, long double b
, enum EXPECTED_RESULT expected
)
24 int x
= __netf2(a
, b
);
25 int ret
= compareResultCMP(x
, expected
);
28 printf("error in test__netf2(%.20Lf, %.20Lf) = %d, "
29 "expected %s\n", a
, b
, x
, expectedStr(expected
));
34 char assumption_1
[sizeof(long double) * CHAR_BIT
== 128] = {0};
40 #if __LP64__ && __LDBL_MANT_DIG__ == 113
42 if (test__netf2(makeQNaN128(),
43 0x1.234567890abcdef1234567890abcp
+3L,
48 if (test__netf2(0x1.234567890abcdef1234567890abcp
-3L,
49 0x1.234567890abcdef1234567890abcp
+3L,
53 if (test__netf2(0x1.234567890abcdef1234567890abcp
+3L,
54 0x1.334567890abcdef1234567890abcp
+3L,
58 if (test__netf2(-0x1.234567890abcdef1234567890abcp
+3L,
59 0x1.234567890abcdef1234567890abcp
+3L,
63 if (test__netf2(0x1.234567890abcdef1234567890abcp
+3L,
64 0x1.234567890abcdef1234567890abcp
+3L,
69 if (test__netf2(0x1.234567890abcdef1234567890abcp
+3L,
70 0x1.234567890abcdef1234567890abcp
-3L,
74 if (test__netf2(0x1.334567890abcdef1234567890abcp
+3L,
75 0x1.234567890abcdef1234567890abcp
+3L,
79 if (test__netf2(0x1.234567890abcdef1234567890abcp
+3L,
80 -0x1.234567890abcdef1234567890abcp
+3L,