1 //===-- umodti3_test.c - Test __umodti3 -----------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file tests __umodti3 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
21 tu_int
__umodti3(tu_int a
, tu_int b
);
23 int test__umodti3(tu_int a
, tu_int b
, tu_int expected_r
)
25 tu_int r
= __umodti3(a
, b
);
35 expected_rt
.all
= expected_r
;
36 printf("error in __umodti3: 0x%llX%.16llX %% 0x%llX%.16llX = "
37 "0x%llX%.16llX, expected 0x%llX%.16llX\n",
38 at
.s
.high
, at
.s
.low
, bt
.s
.high
, bt
.s
.low
, rt
.s
.high
, rt
.s
.low
,
39 expected_rt
.s
.high
, expected_rt
.s
.low
);
41 return r
!= expected_r
;
49 if (test__umodti3(0, 1, 0))
51 if (test__umodti3(2, 1, 0))
53 if (test__umodti3(make_tu(0x8000000000000000uLL
, 0), 1, 0x0uLL
))
55 if (test__umodti3(make_tu(0x8000000000000000uLL
, 0), 2, 0x0uLL
))
57 if (test__umodti3(make_tu(0xFFFFFFFFFFFFFFFFuLL
, 0xFFFFFFFFFFFFFFFFuLL
),