]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/builtins/Unit/fixsfsivfp_test.c
1 // RUN: %clang_builtins %s %librt -o %t && %run %t
3 //===-- fixsfsivfp_test.c - Test __fixsfsivfp -----------------------------===//
5 // The LLVM Compiler Infrastructure
7 // This file is dual licensed under the MIT and the University of Illinois Open
8 // Source Licenses. See LICENSE.TXT for details.
10 //===----------------------------------------------------------------------===//
12 // This file tests __fixsfsivfp for the compiler_rt library.
14 //===----------------------------------------------------------------------===//
21 extern int __fixsfsivfp(float a
);
23 #if __arm__ && __VFP_FP__
24 int test__fixsfsivfp(float a
)
26 int actual
= __fixsfsivfp(a
);
28 if (actual
!= expected
)
29 printf("error in test__fixsfsivfp(%f) = %u, expected %u\n",
31 return actual
!= expected
;
37 #if __arm__ && __VFP_FP__
38 if (test__fixsfsivfp(0.0))
40 if (test__fixsfsivfp(1.0))
42 if (test__fixsfsivfp(-1.0))
44 if (test__fixsfsivfp(2147483647.0))
46 if (test__fixsfsivfp(-2147483648.0))
48 if (test__fixsfsivfp(65536.0))