Home | History | Annotate | Download | only in Support

Lines Matching refs:SwapByteOrder

11 #include "llvm/Support/SwapByteOrder.h"
23 TEST(SwapByteOrder, UnsignedRoundTrip) {
30 sys::SwapByteOrder(sys::SwapByteOrder(origional_uint8)));
34 sys::SwapByteOrder(sys::SwapByteOrder(origional_uint16)));
38 sys::SwapByteOrder(sys::SwapByteOrder(origional_uint32)));
42 sys::SwapByteOrder(sys::SwapByteOrder(origional_uint64)));
48 TEST(SwapByteOrder, SignedRoundTrip) {
55 sys::SwapByteOrder(sys::SwapByteOrder(origional_int8)));
59 sys::SwapByteOrder(sys::SwapByteOrder(origional_int16)));
63 sys::SwapByteOrder(sys::SwapByteOrder(origional_int32)));
67 sys::SwapByteOrder(sys::SwapByteOrder(origional_int64)));
74 sys::SwapByteOrder(sys::SwapByteOrder(origional_int8)));
78 sys::SwapByteOrder(sys::SwapByteOrder(origional_int16)));
82 sys::SwapByteOrder(sys::SwapByteOrder(origional_int32)));
86 sys::SwapByteOrder(sys::SwapByteOrder(origional_int64)));
94 TEST(SwapByteOrder, uint8_t) {
95 EXPECT_EQ(uint8_t(0x11), sys::SwapByteOrder(uint8_t(0x11)));
98 TEST(SwapByteOrder, uint16_t) {
99 EXPECT_EQ(uint16_t(0x1122), sys::SwapByteOrder(uint16_t(0x2211)));
102 TEST(SwapByteOrder, uint32_t) {
103 EXPECT_EQ(uint32_t(0x11223344), sys::SwapByteOrder(uint32_t(0x44332211)));
106 TEST(SwapByteOrder, uint64_t) {
108 sys::SwapByteOrder(uint64_t(0x8877665544332211ULL)));
111 TEST(SwapByteOrder, int8_t) {
112 EXPECT_EQ(int8_t(0x11), sys::SwapByteOrder(int8_t(0x11)));
115 TEST(SwapByteOrder, int16_t) {
116 EXPECT_EQ(int16_t(0x1122), sys::SwapByteOrder(int16_t(0x2211)));
119 TEST(SwapByteOrder, int32_t) {
120 EXPECT_EQ(int32_t(0x11223344), sys::SwapByteOrder(int32_t(0x44332211)));
123 TEST(SwapByteOrder, int64_t) {
125 sys::SwapByteOrder(int64_t(0x8877665544332211LL)));