]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/intrinsics/volatile_order.rs
Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiasko
[rust.git] / src / test / codegen / intrinsics / volatile_order.rs
1 #![crate_type = "lib"]
2 #![feature(core_intrinsics)]
3
4 use std::intrinsics::*;
5
6 pub unsafe fn test_volatile_order() {
7     let mut a: Box<u8> = Box::new(0);
8     // CHECK: load volatile
9     let x = volatile_load(&*a);
10     // CHECK: load volatile
11     let x = volatile_load(&*a);
12     // CHECK: store volatile
13     volatile_store(&mut *a, 12);
14     // CHECK: store volatile
15     unaligned_volatile_store(&mut *a, 12);
16     // CHECK: llvm.memset.p0
17     volatile_set_memory(&mut *a, 12, 1)
18 }