From 625fa742bca46f992c347c438658d6b747e03c51 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 24 Jan 2020 19:02:58 -0600 Subject: [PATCH 1/2] Shim intrinsics::atomic_singlethreadfence, etc. --- src/shims/intrinsics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index 151edfda43..04e724ff1d 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -113,6 +113,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx | "atomic_fence_rel" | "atomic_fence_acqrel" | "atomic_fence" + | "atomic_singlethreadfence_acq" + | "atomic_singlethreadfence_rel" + | "atomic_singlethreadfence_acqrel" + | "atomic_singlethreadfence" => { // we are inherently singlethreaded and singlecored, this is a nop } From 9265e0cd5e4e9677ef5bdcea7a781ae7d064b4e2 Mon Sep 17 00:00:00 2001 From: David Cook Date: Sat, 25 Jan 2020 13:48:26 -0600 Subject: [PATCH 2/2] Add compiler fences to test --- tests/run-pass/atomic.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/run-pass/atomic.rs b/tests/run-pass/atomic.rs index a9dd29bd62..b03a8c8901 100644 --- a/tests/run-pass/atomic.rs +++ b/tests/run-pass/atomic.rs @@ -1,4 +1,4 @@ -use std::sync::atomic::{fence, AtomicBool, AtomicIsize, AtomicU64, Ordering::*}; +use std::sync::atomic::{compiler_fence, fence, AtomicBool, AtomicIsize, AtomicU64, Ordering::*}; fn main() { atomic_bool(); @@ -70,4 +70,8 @@ fn atomic_fences() { fence(Release); fence(Acquire); fence(AcqRel); + compiler_fence(SeqCst); + compiler_fence(Release); + compiler_fence(Acquire); + compiler_fence(AcqRel); }