1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_mulsf3vfp
3 //===-- mulsf3vfp_test.c - Test __mulsf3vfp -------------------------------===//
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 __mulsf3vfp for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
21 extern COMPILER_RT_ABI
float __mulsf3vfp(float a
, float b
);
23 #if __arm__ && __VFP_FP__
24 int test__mulsf3vfp(float a
, float b
)
26 float actual
= __mulsf3vfp(a
, b
);
27 float expected
= a
* b
;
28 if (actual
!= expected
)
29 printf("error in test__mulsf3vfp(%f, %f) = %f, expected %f\n",
30 a
, b
, actual
, expected
);
31 return actual
!= expected
;
37 #if __arm__ && __VFP_FP__
38 if (test__mulsf3vfp(0.5, 10.0))
40 if (test__mulsf3vfp(-0.5, -2.0))
42 if (test__mulsf3vfp(HUGE_VALF
, 0.25))
44 if (test__mulsf3vfp(-0.125, HUGE_VALF
))
46 if (test__mulsf3vfp(0.0, -0.0))