Skip to content

Commit b222677

Browse files
committed
Auto merge of #1150 - divergentdave:patch-1, r=RalfJung
Shim intrinsics::atomic_singlethreadfence, etc. This applies the no-op shim for atomic fences to `atomic_singlethreadfence` and related intrinsics.
2 parents a737ea6 + 9265e0c commit b222677

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/shims/intrinsics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
113113
| "atomic_fence_rel"
114114
| "atomic_fence_acqrel"
115115
| "atomic_fence"
116+
| "atomic_singlethreadfence_acq"
117+
| "atomic_singlethreadfence_rel"
118+
| "atomic_singlethreadfence_acqrel"
119+
| "atomic_singlethreadfence"
116120
=> {
117121
// we are inherently singlethreaded and singlecored, this is a nop
118122
}

tests/run-pass/atomic.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::sync::atomic::{fence, AtomicBool, AtomicIsize, AtomicU64, Ordering::*};
1+
use std::sync::atomic::{compiler_fence, fence, AtomicBool, AtomicIsize, AtomicU64, Ordering::*};
22

33
fn main() {
44
atomic_bool();
@@ -70,4 +70,8 @@ fn atomic_fences() {
7070
fence(Release);
7171
fence(Acquire);
7272
fence(AcqRel);
73+
compiler_fence(SeqCst);
74+
compiler_fence(Release);
75+
compiler_fence(Acquire);
76+
compiler_fence(AcqRel);
7377
}

0 commit comments

Comments
 (0)