We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ae4ee8 commit 3b67e46Copy full SHA for 3b67e46
src/test/run-make/volatile-intrinsics/main.rs
@@ -8,14 +8,20 @@
8
// option. This file may not be copied, modified, or distributed
9
// except according to those terms.
10
11
-#![feature(core_intrinsics)]
+#![feature(core_intrinsics, volatile)]
12
13
use std::intrinsics::{volatile_load, volatile_store};
14
+use std::ptr::{read_volatile, write_volatile};
15
16
pub fn main() {
17
unsafe {
18
let mut i : isize = 1;
19
volatile_store(&mut i, 2);
20
assert_eq!(volatile_load(&i), 2);
21
}
22
+ unsafe {
23
+ let mut i : isize = 1;
24
+ write_volatile(&mut i, 2);
25
+ assert_eq!(read_volatile(&i), 2);
26
+ }
27
0 commit comments