diff options
| author | Jake Goulding <jake.goulding@gmail.com> | 2016-05-06 09:31:11 -0400 |
|---|---|---|
| committer | Jake Goulding <jake.goulding@gmail.com> | 2016-05-19 13:55:13 -0400 |
| commit | bc7595c8abbf4e3b737e926d61814686e0ebda77 (patch) | |
| tree | 3ead763b6c18622639409543dc3a46ba1e6374c1 /src/libcoretest | |
| parent | 2fb6f8e2c94a7041877ed8460f2621974c5233f7 (diff) | |
| download | rust-bc7595c8abbf4e3b737e926d61814686e0ebda77.tar.gz rust-bc7595c8abbf4e3b737e926d61814686e0ebda77.zip | |
Support 16-bit pointers as well as i/usize
This is based on the original work of Dylan McKay for the [avr-rust project][ar]. [ar]: https://github.com/avr-rust/rust
Diffstat (limited to 'src/libcoretest')
| -rw-r--r-- | src/libcoretest/mem.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcoretest/mem.rs b/src/libcoretest/mem.rs index 5bc08376d25..01bafe49a7a 100644 --- a/src/libcoretest/mem.rs +++ b/src/libcoretest/mem.rs @@ -19,6 +19,13 @@ fn size_of_basic() { } #[test] +#[cfg(target_pointer_width = "16")] +fn size_of_16() { + assert_eq!(size_of::<usize>(), 2); + assert_eq!(size_of::<*const usize>(), 2); +} + +#[test] #[cfg(target_pointer_width = "32")] fn size_of_32() { assert_eq!(size_of::<usize>(), 4); @@ -48,6 +55,13 @@ fn align_of_basic() { } #[test] +#[cfg(target_pointer_width = "16")] +fn align_of_16() { + assert_eq!(align_of::<usize>(), 2); + assert_eq!(align_of::<*const usize>(), 2); +} + +#[test] #[cfg(target_pointer_width = "32")] fn align_of_32() { assert_eq!(align_of::<usize>(), 4); |
