1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_floatsisfvfp
3 //===-- floatsisfvfp_test.c - Test __floatsisfvfp -------------------------===//
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 __floatsisfvfp for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
21 extern COMPILER_RT_ABI
float __floatsisfvfp(int a
);
23 #if __arm__ && __VFP_FP__
24 int test__floatsisfvfp(int a
)
26 float actual
= __floatsisfvfp(a
);
28 if (actual
!= expected
)
29 printf("error in test__floatsisfvfp(%d) = %f, expected %f\n",
31 return actual
!= expected
;
37 #if __arm__ && __VFP_FP__
38 if (test__floatsisfvfp(0))
40 if (test__floatsisfvfp(1))
42 if (test__floatsisfvfp(-1))
44 if (test__floatsisfvfp(0x7FFFFFFF))
46 if (test__floatsisfvfp(0x80000000))