[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / compiler-rt / test / builtins / Unit / arm / aeabi_drsub_test.c
blob1a1aa2856e6924002044997ccf748431b6e3a425
1 // REQUIRES: arm-target-arch || armv6m-target-arch
2 // RUN: %clang_builtins %s %librt -o %t && %run %t
3 //===-- aeabi_drsub.c - Test __aeabi_drsub --------------------------------===//
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 __aeabi_drsub for the compiler_rt library.
13 //===----------------------------------------------------------------------===//
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <math.h>
20 #if __arm__
21 extern __attribute__((pcs("aapcs"))) double __aeabi_drsub(double a, double b);
23 int test__aeabi_drsub(double a, double b, double expected)
25 double actual = __aeabi_drsub(a, b);
26 if (actual != expected)
27 printf("error in __aeabi_drsub(%f, %f) = %f, expected %f\n",
28 a, b, actual, expected);
29 return actual != expected;
31 #endif
33 int main()
35 #if __arm__
36 if (test__aeabi_drsub(1.0, 1.0, 0.0))
37 return 1;
38 if (test__aeabi_drsub(1234.567, 765.4321, -469.134900))
39 return 1;
40 if (test__aeabi_drsub(-123.0, -678.0, -555.0))
41 return 1;
42 if (test__aeabi_drsub(0.0, -0.0, 0.0))
43 return 1;
44 #else
45 printf("skipped\n");
46 #endif
47 return 0;