1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_truncdfsf2
4 //===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===//
6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
7 // See https://llvm.org/LICENSE.txt for license information.
8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 //===----------------------------------------------------------------------===//
12 // This file tests __truncdfsf2 for the compiler_rt library.
14 //===----------------------------------------------------------------------===//
20 float __truncdfsf2(double a
);
22 int test__truncdfsf2(double a
)
24 float actual
= __truncdfsf2(a
);
27 if (actual
!= expected
) {
28 printf("error in test__truncdfsf2(%lf) = %f, "
29 "expected %f\n", a
, actual
, expected
);
37 if (test__truncdfsf2(340282366920938463463374607431768211456.0))