Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Generalise pointer width tests using pointer_width
  • Loading branch information
richo committed Jan 14, 2015
commit c51379386cbd50e30b7c6c6d2eb618d2c982ff55
18 changes: 4 additions & 14 deletions src/libcoretest/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,14 @@ fn size_of_basic() {
}

#[test]
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"))]
#[cfg(target_pointer_width = "32")]
fn size_of_32() {
assert_eq!(size_of::<uint>(), 4u);
assert_eq!(size_of::<*const uint>(), 4u);
}

#[test]
#[cfg(any(target_arch = "x86_64",
target_arch = "aarch64"))]
#[cfg(target_pointer_width = "64")]
fn size_of_64() {
assert_eq!(size_of::<uint>(), 8u);
assert_eq!(size_of::<*const uint>(), 8u);
Expand All @@ -53,19 +48,14 @@ fn align_of_basic() {
}

#[test]
#[cfg(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc"))]
#[cfg(target_pointer_width = "32")]
fn align_of_32() {
assert_eq!(align_of::<uint>(), 4u);
assert_eq!(align_of::<*const uint>(), 4u);
}

#[test]
#[cfg(any(target_arch = "x86_64",
target_arch = "aarch64"))]
#[cfg(target_pointer_width = "64")]
fn align_of_64() {
assert_eq!(align_of::<uint>(), 8u);
assert_eq!(align_of::<*const uint>(), 8u);
Expand Down