2020-08-16 10:08:34 -05:00
|
|
|
// compile-flags: -Zmiri-symbolic-alignment-check
|
2019-08-02 13:20:56 -05:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Do a 4-aligned u64 atomic access. That should be UB on all platforms,
|
|
|
|
// even if u64 only has alignment 4.
|
|
|
|
let z = [0u32; 2];
|
|
|
|
let zptr = &z as *const _ as *const u64;
|
|
|
|
unsafe {
|
2022-06-29 07:33:06 -05:00
|
|
|
::std::intrinsics::atomic_load_seqcst(zptr);
|
2020-08-18 03:11:54 -05:00
|
|
|
//~^ERROR accessing memory with alignment 4, but alignment 8 is required
|
2019-08-02 13:20:56 -05:00
|
|
|
}
|
|
|
|
}
|