// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::mem::size_of; #[repr(i8)] enum Ei8 { Ai8 = 0, Bi8 = 1 } #[repr(u8)] enum Eu8 { Au8 = 0, Bu8 = 1 } #[repr(i16)] enum Ei16 { Ai16 = 0, Bi16 = 1 } #[repr(u16)] enum Eu16 { Au16 = 0, Bu16 = 1 } #[repr(i32)] enum Ei32 { Ai32 = 0, Bi32 = 1 } #[repr(u32)] enum Eu32 { Au32 = 0, Bu32 = 1 } #[repr(i64)] enum Ei64 { Ai64 = 0, Bi64 = 1 } #[repr(u64)] enum Eu64 { Au64 = 0, Bu64 = 1 } #[repr(isize)] enum Eint { Aint = 0, Bint = 1 } #[repr(usize)] enum Euint { Auint = 0, Buint = 1 } #[repr(i64)] enum Ei64_non_c_like { _None, _Some(T), } #[repr(u64)] enum Eu64_non_c_like { _None, _Some(T), } pub fn main() { assert_eq!(size_of::(), 1); assert_eq!(size_of::(), 1); assert_eq!(size_of::(), 2); assert_eq!(size_of::(), 2); assert_eq!(size_of::(), 4); assert_eq!(size_of::(), 4); assert_eq!(size_of::(), 8); assert_eq!(size_of::(), 8); assert_eq!(size_of::(), size_of::()); assert_eq!(size_of::(), size_of::()); assert_eq!(size_of::>(), 8); assert_eq!(size_of::>(), 8); }