[AMDGPU] Remove s_wakeup_barrier instruction (#122277)
[llvm-project.git] / compiler-rt / test / builtins / Unit / fixtfsi_test.c
blobf874d6b032df73fdec2b392a23e17d69ee2e7f2e
1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_fixtfsi
4 #include <stdio.h>
6 #if __LDBL_MANT_DIG__ == 113
8 #include "fp_test.h"
10 int __fixtfsi(long double a);
12 int test__fixtfsi(long double a, int expected)
14 int x = __fixtfsi(a);
15 int ret = (x != expected);
17 if (ret){
18 printf("error in test__fixtfsi(%.20Lf) = %d, "
19 "expected %d\n", a, x, expected);
21 return ret;
24 char assumption_1[sizeof(long double) * CHAR_BIT == 128] = {0};
26 #endif
28 int main()
30 #if __LDBL_MANT_DIG__ == 113
31 if (test__fixtfsi(makeInf128(), 0x7fffffff))
32 return 1;
33 if (test__fixtfsi(0, 0x0))
34 return 1;
35 if (test__fixtfsi(0x1.23456789abcdefp+5, 0x24))
36 return 1;
37 if (test__fixtfsi(0x1.23456789abcdefp-3, 0x0))
38 return 1;
39 if (test__fixtfsi(0x1.23456789abcdefp+20, 0x123456))
40 return 1;
41 if (test__fixtfsi(0x1.23456789abcdefp+40, 0x7fffffff))
42 return 1;
43 if (test__fixtfsi(0x1.23456789abcdefp+256, 0x7fffffff))
44 return 1;
45 if (test__fixtfsi(-0x1.23456789abcdefp+20, 0xffedcbaa))
46 return 1;
47 if (test__fixtfsi(-0x1.23456789abcdefp+40, 0x80000000))
48 return 1;
50 #else
51 printf("skipped\n");
53 #endif
54 return 0;