blob: 8f8086b3538c6ca397150c6203aa658ee9a8d3de [file] [log] [blame]
// Stacked Borrows doesn't like this.
//@compile-flags: -Zmiri-tree-borrows
use std::sync::atomic::*;
fn main() {
// Atomic loads from read-only memory are fine if they are relaxed and small.
static X: i32 = 0;
let x = &X as *const i32 as *const AtomicI32;
let x = unsafe { &*x };
x.load(Ordering::Relaxed);
}