1 // UNSUPPORTED: armv6m-target-arch
2 // RUN: %clang_builtins %s %librt -o %t && %run %t
3 // REQUIRES: librt_has_bswapdi2
10 extern uint64_t __bswapdi2(uint64_t);
12 int test__bswapdi2(uint64_t a
, uint64_t expected
) {
13 uint64_t actual
= __bswapdi2(a
);
14 if (actual
!= expected
)
15 printf("error in test__bswapsi2(0x%0llX) = 0x%0llX, expected 0x%0llX\n", a
,
17 return actual
!= expected
;
21 if (test__bswapdi2(0x123456789ABCDEF0LL
, 0xF0DEBC9A78563412LL
))
23 if (test__bswapdi2(0x0000000100000002LL
, 0x0200000001000000LL
))