rust/tests/run-pass/volatile.rs
rchaser53 b1c0cf2ef9 use copy_op directly insteadof write_scalar
- fix volatile_store logic
- rename test to be able to read back from later
- expand test to use assert_eq! and confirm to fix volatile_store
- expand test to use assert_eq! and confirm normal load
2019-02-26 19:49:02 +09:00

13 lines
307 B
Rust

// related: #58645
#![feature(core_intrinsics)]
use std::intrinsics::{volatile_load, volatile_store};
pub fn main() {
unsafe {
let i: &mut (isize, isize) = &mut (0, 0);
volatile_store(i, (1, 2));
assert_eq!(volatile_load(i), (1, 2));
assert_eq!(i, &mut (1, 2));
}
}