diff options
| author | bors <bors@rust-lang.org> | 2016-06-03 22:32:15 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-06-03 22:32:15 -0700 |
| commit | 7738479d72418ddc08febee0fa7097df334d357e (patch) | |
| tree | 02db04b160da2230fa0097d6fea5331237945e29 /src/libcoretest | |
| parent | c81c75076c05990af6f71e56ccc12d7b196ee25c (diff) | |
| parent | bc7595c8abbf4e3b737e926d61814686e0ebda77 (diff) | |
| download | rust-7738479d72418ddc08febee0fa7097df334d357e.tar.gz rust-7738479d72418ddc08febee0fa7097df334d357e.zip | |
Auto merge of #33460 - shepmaster:16-bit-pointers, r=Aatch
Support 16-bit pointers as well as i/usize I'm opening this pull request to get some feedback from the community. Although Rust doesn't support any platforms with a native 16-bit pointer at the moment, the [AVR-Rust][ar] fork is working towards that goal. Keeping this forked logic up-to-date with the changes in master has been onerous so I'd like to merge these changes so that they get carried along when refactoring happens. I do not believe this should increase the maintenance burden. This is based on the original work of Dylan McKay (@dylanmckay). [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); |
