]> git.proxmox.com Git - rustc.git/blame - src/libcompiler_builtins/compiler-rt/test/builtins/Unit/truncdfsf2_test.c
New upstream version 1.28.0+dfsg1
[rustc.git] / src / libcompiler_builtins / compiler-rt / test / builtins / Unit / truncdfsf2_test.c
CommitLineData
2c00a5a8
XL
1// RUN: %clang_builtins %s %librt -o %t && %run %t
2
92a42be0
SL
3//===--------------- truncdfsf2_test.c - Test __truncdfsf2 ----------------===//
4//
5// The LLVM Compiler Infrastructure
6//
7// This file is dual licensed under the MIT and the University of Illinois Open
8// Source Licenses. See LICENSE.TXT for details.
9//
10//===----------------------------------------------------------------------===//
11//
12// This file tests __truncdfsf2 for the compiler_rt library.
13//
14//===----------------------------------------------------------------------===//
15
16#include <stdio.h>
17
18#include "fp_test.h"
19
20float __truncdfsf2(double a);
21
22int test__truncdfsf2(double a)
23{
24 float actual = __truncdfsf2(a);
25 float expected = a;
26
27 if (actual != expected) {
28 printf("error in test__truncdfsf2(%lf) = %f, "
29 "expected %f\n", a, actual, expected);
30 return 1;
31 }
32 return 0;
33}
34
35int main()
36{
37 if (test__truncdfsf2(340282366920938463463374607431768211456.0))
38 return 1;
39 return 0;
40}