]> git.proxmox.com Git - rustc.git/blob - src/test/codegen/intrinsics/volatile_order.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.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.p0i8
17 volatile_set_memory(&mut *a, 12, 1)
18 }