Skip to content

Commit c513793

Browse files
committed
Generalise pointer width tests using pointer_width
1 parent 043a4b3 commit c513793

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/libcoretest/mem.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@ fn size_of_basic() {
1919
}
2020

2121
#[test]
22-
#[cfg(any(target_arch = "x86",
23-
target_arch = "arm",
24-
target_arch = "mips",
25-
target_arch = "mipsel",
26-
target_arch = "powerpc"))]
22+
#[cfg(target_pointer_width = "32")]
2723
fn size_of_32() {
2824
assert_eq!(size_of::<uint>(), 4u);
2925
assert_eq!(size_of::<*const uint>(), 4u);
3026
}
3127

3228
#[test]
33-
#[cfg(any(target_arch = "x86_64",
34-
target_arch = "aarch64"))]
29+
#[cfg(target_pointer_width = "64")]
3530
fn size_of_64() {
3631
assert_eq!(size_of::<uint>(), 8u);
3732
assert_eq!(size_of::<*const uint>(), 8u);
@@ -53,19 +48,14 @@ fn align_of_basic() {
5348
}
5449

5550
#[test]
56-
#[cfg(any(target_arch = "x86",
57-
target_arch = "arm",
58-
target_arch = "mips",
59-
target_arch = "mipsel",
60-
target_arch = "powerpc"))]
51+
#[cfg(target_pointer_width = "32")]
6152
fn align_of_32() {
6253
assert_eq!(align_of::<uint>(), 4u);
6354
assert_eq!(align_of::<*const uint>(), 4u);
6455
}
6556

6657
#[test]
67-
#[cfg(any(target_arch = "x86_64",
68-
target_arch = "aarch64"))]
58+
#[cfg(target_pointer_width = "64")]
6959
fn align_of_64() {
7060
assert_eq!(align_of::<uint>(), 8u);
7161
assert_eq!(align_of::<*const uint>(), 8u);

0 commit comments

Comments
 (0)