1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_fixunsdfsivfp
3 //===-- fixunsdfsivfp_test.c - Test __fixunsdfsivfp -----------------------===//
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 __fixunsdfsivfp for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
21 extern COMPILER_RT_ABI
unsigned int __fixunsdfsivfp(double a
);
23 #if __arm__ && __VFP_FP__
24 int test__fixunsdfsivfp(double a
)
26 unsigned int actual
= __fixunsdfsivfp(a
);
27 unsigned int expected
= a
;
28 if (actual
!= expected
)
29 printf("error in test__fixunsdfsivfp(%f) = %u, expected %u\n",
31 return actual
!= expected
;
37 #if __arm__ && __VFP_FP__
38 if (test__fixunsdfsivfp(0.0))
40 if (test__fixunsdfsivfp(1.0))
42 if (test__fixunsdfsivfp(-1.0))
44 if (test__fixunsdfsivfp(4294967295.0))
46 if (test__fixunsdfsivfp(65536.0))