1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_divdf3
3 //===--------------- divdf3_test.c - Test __divdf3 ------------------------===//
5 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6 // See https://llvm.org/LICENSE.txt for license information.
7 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 //===----------------------------------------------------------------------===//
11 // This file tests __divdf3 for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
21 COMPILER_RT_ABI
double __divdf3(double a
, double b
);
23 int test__divdf3(double a
, double b
, uint64_t expected
)
25 double x
= __divdf3(a
, b
);
26 int ret
= compareResultD(x
, expected
);
29 printf("error in test__divdf3(%.20e, %.20e) = %.20e, "
30 "expected %.20e\n", a
, b
, x
,
39 if (test__divdf3(1., 3., 0x3fd5555555555555ULL
))
41 // smallest normal result
42 if (test__divdf3(4.450147717014403e-308, 2., 0x10000000000000ULL
))