2 #![feature(const_int_ops)]
6 use test::black_box as b;
8 const BE_U32: u32 = 55u32.to_be();
9 const LE_U32: u32 = 55u32.to_le();
13 assert_eq!(BE_U32, b(55u32).to_be());
14 assert_eq!(LE_U32, b(55u32).to_le());
16 #[cfg(not(target_os = "emscripten"))]
18 const BE_U128: u128 = 999999u128.to_be();
19 const LE_I128: i128 = (-999999i128).to_le();
20 assert_eq!(BE_U128, b(999999u128).to_be());
21 assert_eq!(LE_I128, b(-999999i128).to_le());