Skip to content

Commit 8fcaaa2

Browse files
committed
Simplify known C++20 inconsistency test
1 parent fee0325 commit 8fcaaa2

File tree

3 files changed

+9
-28
lines changed

3 files changed

+9
-28
lines changed

tests/fail/weak_memory/cpp20_rwc_syncs.rs renamed to tests/fail/should-pass/cpp20_rwc_syncs.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-ignore-leaks
3+
// error-pattern:
34

45
// https://plv.mpi-sws.org/scfix/paper.pdf
56
// 2.2 Second Problem: SC Fences are Too Weak
@@ -70,12 +71,12 @@ fn test_cpp20_rwc_syncs() {
7071
let b = j2.join().unwrap();
7172
let c = j3.join().unwrap();
7273

74+
// We cannot write assert_ne!() since ui_test's fail
75+
// tests expect exit status 1, whereas panics produce 101.
76+
// Our ui_test does not yet support overriding failure status codes.
7377
if (b, c) == (0, 0) {
74-
// FIXME: the standalone compiletest-rs needs to support
75-
// failure-status header to allow us to write assert_ne!((b, c), (0, 0))
76-
// https://rustc-dev-guide.rust-lang.org/tests/headers.html#miscellaneous-headers
77-
// because panic exits with 101 but compile-rs expects 1
78-
let _ = unsafe { std::mem::MaybeUninit::<*const u32>::uninit().assume_init() }; //~ ERROR uninitialized
78+
// This *should* be unreachable, but Miri will reach it.
79+
std::process::exit(1);
7980
}
8081
}
8182

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
warning: thread support is experimental: the scheduler is not preemptive, and can get stuck in spin loops.
2+
(see https://github.com/rust-lang/miri/issues/1388)
3+

tests/fail/weak_memory/cpp20_rwc_syncs.stderr

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)