1 //===-- bswapsi2_test.c - Test __bswapsi2 ---------------------------------===//
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 __bswapsi2 for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
20 extern uint32_t __bswapsi2(uint32_t);
23 int test__bswapsi2(uint32_t a
, uint32_t expected
)
25 uint32_t actual
= __bswapsi2(a
);
26 if (actual
!= expected
)
27 printf("error in test__bswapsi2(0x%0X) = 0x%0X, expected 0x%0X\n",
29 return actual
!= expected
;
36 if (test__bswapsi2(0x12345678, 0x78563412))
38 if (test__bswapsi2(0x00000001, 0x01000000))