1 // RUN: %clang_builtins %s %librt -o %t && %run %t
2 // REQUIRES: librt_has_umoddi3
9 COMPILER_RT_ABI du_int
__umoddi3(du_int a
, du_int b
);
11 int test__umoddi3(du_int a
, du_int b
, du_int expected_r
)
13 du_int r
= __umoddi3(a
, b
);
15 printf("error in __umoddi3: %lld %% %lld = %lld, expected %lld\n",
17 return r
!= expected_r
;
22 if (test__umoddi3(0, 1, 0))
24 if (test__umoddi3(2, 1, 0))
26 if (test__umoddi3(0x8000000000000000uLL
, 1, 0x0uLL
))
28 if (test__umoddi3(0x8000000000000000uLL
, 2, 0x0uLL
))
30 if (test__umoddi3(0xFFFFFFFFFFFFFFFFuLL
, 2, 0x1uLL
))