1 //===-- bswapdi2_test.c - Test __bswapdi2 ---------------------------------===//
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 __bswapdi2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
20 extern uint64_t __bswapdi2(uint64_t);
23 int test__bswapdi2(uint64_t a
, uint64_t expected
)
25 uint64_t actual
= __bswapdi2(a
);
26 if (actual
!= expected
)
27 printf("error in test__bswapsi2(0x%0llX) = 0x%0llX, expected 0x%0llX\n",
29 return actual
!= expected
;
36 if (test__bswapdi2(0x123456789ABCDEF0LL
, 0xF0DEBC9A78563412LL
))
38 if (test__bswapdi2(0x0000000100000002LL
, 0x0200000001000000LL
))