]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/builtins/Unit/eqsf2vfp_test.c
1 // RUN: %clang_builtins %s %librt -o %t && %run %t
3 //===-- eqsf2vfp_test.c - Test __eqsf2vfp ---------------------------------===//
5 // The LLVM Compiler Infrastructure
7 // This file is dual licensed under the MIT and the University of Illinois Open
8 // Source Licenses. See LICENSE.TXT for details.
10 //===----------------------------------------------------------------------===//
12 // This file tests __eqsf2vfp for the compiler_rt library.
14 //===----------------------------------------------------------------------===//
22 extern int __eqsf2vfp(float a
, float b
);
24 #if __arm__ && __VFP_FP__
25 int test__eqsf2vfp(float a
, float b
)
27 int actual
= __eqsf2vfp(a
, b
);
28 int expected
= (a
== b
) ? 1 : 0;
29 if (actual
!= expected
)
30 printf("error in __eqsf2vfp(%f, %f) = %d, expected %d\n",
31 a
, b
, actual
, expected
);
32 return actual
!= expected
;
38 #if __arm__ && __VFP_FP__
39 if (test__eqsf2vfp(0.0, 0.0))
41 if (test__eqsf2vfp(1.0, 1.0))
43 if (test__eqsf2vfp(-1.0, -1.0))
45 if (test__eqsf2vfp(HUGE_VALF
, 1.0))
47 if (test__eqsf2vfp(1.0, HUGE_VALF
))