1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 // ignore-cross-compile
20 static static_val: u32 = fourcc!("foo ");
21 static static_val_be: u32 = fourcc!("foo ", big);
22 static static_val_le: u32 = fourcc!("foo ", little);
23 static static_val_target: u32 = fourcc!("foo ", target);
26 let val = fourcc!("foo ", big);
27 assert_eq!(val, 0x666f6f20u32);
28 assert_eq!(val, fourcc!("foo "));
30 let val = fourcc!("foo ", little);
31 assert_eq!(val, 0x206f6f66u32);
33 let val = fourcc!("foo ", target);
34 let exp = if cfg!(target_endian = "big") { 0x666f6f20u32 } else { 0x206f6f66u32 };
37 assert_eq!(static_val_be, 0x666f6f20u32);
38 assert_eq!(static_val, static_val_be);
39 assert_eq!(static_val_le, 0x206f6f66u32);
40 let exp = if cfg!(target_endian = "big") { 0x666f6f20u32 } else { 0x206f6f66u32 };
41 assert_eq!(static_val_target, exp);
43 assert_eq!(fourcc!("\xC0\xFF\xEE!"), 0xC0FFEE21);