1 //===-- umoddi3_test.c - Test __umoddi3 -----------------------------------===//
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 __umoddi3 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
19 du_int
__umoddi3(du_int a
, du_int b
);
21 int test__umoddi3(du_int a
, du_int b
, du_int expected_r
)
23 du_int r
= __umoddi3(a
, b
);
25 printf("error in __umoddi3: %lld %% %lld = %lld, expected %lld\n",
27 return r
!= expected_r
;
32 if (test__umoddi3(0, 1, 0))
34 if (test__umoddi3(2, 1, 0))
36 if (test__umoddi3(0x8000000000000000uLL
, 1, 0x0uLL
))
38 if (test__umoddi3(0x8000000000000000uLL
, 2, 0x0uLL
))
40 if (test__umoddi3(0xFFFFFFFFFFFFFFFFuLL
, 2, 0x1uLL
))