[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / compiler-rt / test / builtins / Unit / truncdfsf2_test.c
blob32972dabd8789c0b7dca22ad1d464e61d11c0713
1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_truncdfsf2
4 //===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===//
5 //
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
9 //
10 //===----------------------------------------------------------------------===//
12 // This file tests __truncdfsf2 for the compiler_rt library.
14 //===----------------------------------------------------------------------===//
16 #include <stdio.h>
18 #include "fp_test.h"
20 float __truncdfsf2(double a);
22 int test__truncdfsf2(double a)
24 float actual = __truncdfsf2(a);
25 float expected = a;
27 if (actual != expected) {
28 printf("error in test__truncdfsf2(%lf) = %f, "
29 "expected %f\n", a, actual, expected);
30 return 1;
32 return 0;
35 int main()
37 if (test__truncdfsf2(340282366920938463463374607431768211456.0))
38 return 1;
39 return 0;