Simplify known C++20 inconsistency test

This commit is contained in:
Andy Wang 2022-06-05 10:37:40 +01:00
parent 65f39bd5cf
commit 1379036713
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374
3 changed files with 9 additions and 28 deletions

View file

@ -1,5 +1,6 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-ignore-leaks
// error-pattern:
// https://plv.mpi-sws.org/scfix/paper.pdf
// 2.2 Second Problem: SC Fences are Too Weak
@ -70,12 +71,12 @@ fn test_cpp20_rwc_syncs() {
let b = j2.join().unwrap();
let c = j3.join().unwrap();
// We cannot write assert_ne!() since ui_test's fail
// tests expect exit status 1, whereas panics produce 101.
// Our ui_test does not yet support overriding failure status codes.
if (b, c) == (0, 0) {
// FIXME: the standalone compiletest-rs needs to support
// failure-status header to allow us to write assert_ne!((b, c), (0, 0))
// https://rustc-dev-guide.rust-lang.org/tests/headers.html#miscellaneous-headers
// because panic exits with 101 but compile-rs expects 1
let _ = unsafe { std::mem::MaybeUninit::<*const u32>::uninit().assume_init() }; //~ ERROR uninitialized
// This *should* be unreachable, but Miri will reach it.
std::process::exit(1);
}
}

View file

@ -0,0 +1,3 @@
warning: thread support is experimental: the scheduler is not preemptive, and can get stuck in spin loops.
(see https://github.com/rust-lang/miri/issues/1388)

View file

@ -1,23 +0,0 @@
warning: thread support is experimental: the scheduler is not preemptive, and can get stuck in spin loops.
(see https://github.com/rust-lang/miri/issues/1388)
error: Undefined Behavior: type validation failed at .value: encountered uninitialized raw pointer
--> $DIR/cpp20_rwc_syncs.rs:LL:CC
|
LL | let _ = unsafe { std::mem::MaybeUninit::<*const u32>::uninit().assume_init() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .value: encountered uninitialized raw pointer
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: inside `test_cpp20_rwc_syncs` at $DIR/cpp20_rwc_syncs.rs:LL:CC
note: inside `main` at $DIR/cpp20_rwc_syncs.rs:LL:CC
--> $DIR/cpp20_rwc_syncs.rs:LL:CC
|
LL | test_cpp20_rwc_syncs();
| ^^^^^^^^^^^^^^^^^^^^^^
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to previous error; 1 warning emitted