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