[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / compiler-rt / test / builtins / Unit / muldf3vfp_test.c
blobb8c78597317db1e7dc22d56d761dda33615c6fd3
1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_muldf3vfp
3 //===-- muldf3vfp_test.c - Test __muldf3vfp -------------------------------===//
4 //
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
8 //
9 //===----------------------------------------------------------------------===//
11 // This file tests __muldf3vfp for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
15 #include "int_lib.h"
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <math.h>
21 #if __arm__ && __VFP_FP__
22 extern COMPILER_RT_ABI double __muldf3vfp(double a, double b);
24 int test__muldf3vfp(double a, double b)
26 double actual = __muldf3vfp(a, b);
27 double expected = a * b;
28 if (actual != expected)
29 printf("error in test__muldf3vfp(%f, %f) = %f, expected %f\n",
30 a, b, actual, expected);
31 return actual != expected;
33 #endif
35 int main()
37 #if __arm__ && __VFP_FP__
38 if (test__muldf3vfp(0.5, 10.0))
39 return 1;
40 if (test__muldf3vfp(-0.5, -2.0))
41 return 1;
42 if (test__muldf3vfp(HUGE_VALF, 0.25))
43 return 1;
44 if (test__muldf3vfp(-0.125, HUGE_VALF))
45 return 1;
46 if (test__muldf3vfp(0.0, -0.0))
47 return 1;
48 #else
49 printf("skipped\n");
50 #endif
51 return 0;