Port all tests
This commit is contained in:
parent
e4f7c6845c
commit
6e106617f1
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-strict-provenance
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
|
||||
// Taken from <https://github.com/rust-lang/unsafe-code-guidelines/issues/194#issuecomment-520934222>.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
// Joining a detached thread is undefined behavior.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
// Joining an already joined thread is undefined behavior.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
// Joining the main thread is undefined behavior.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
// Joining the same thread from multiple threads is undefined behavior.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
// We are making scheduler assumptions here.
|
||||
// compile-flags: -Zmiri-preemption-rate=0
|
||||
//@compile-flags: -Zmiri-preemption-rate=0
|
||||
|
||||
// Joining itself is undefined behavior.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
//! Ensure that thread-local statics get deallocated when the thread dies.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
//! The thread function must have exactly one argument.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
//! The thread function must have exactly one argument.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-abi-check
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-abi-check
|
||||
|
||||
//! Unwinding past the top frame of a stack is Undefined Behavior.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
use std::ptr;
|
||||
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let p = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0 -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmir-opt-level=0 -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let p = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation.
|
||||
// compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-disable-validation -Zmiri-permissive-provenance
|
||||
|
||||
fn main() {
|
||||
let x = 16usize as *const u32;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// should find the bug even without these, but gets masked by optimizations
|
||||
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0
|
||||
|
||||
struct SliceWithHead(u8, [u8]);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// This pointer *could* be NULL so we cannot load from it, not even at ZST
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// This pointer *could* be NULL so we cannot load from it, not even at ZST.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmir-opt-level=0
|
||||
|
||||
#[allow(deref_nullptr)]
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation, but some MIR opts mask the error
|
||||
// compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0
|
||||
|
||||
unsafe fn make_ref<'a>(x: *mut i32) -> &'a mut i32 {
|
||||
&mut *x
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation, but some MIR opts mask the error
|
||||
// compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0 -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0 -Zmiri-permissive-provenance
|
||||
|
||||
static mut LEAK: usize = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
fn main() {
|
||||
let p = 44 as *const i32;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
#![feature(new_uninit)]
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
#![feature(new_uninit)]
|
||||
|
||||
use std::ptr::null_mut;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
use std::intrinsics;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
use std::intrinsics::atomic_store;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
use std::intrinsics::atomic_store;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
use std::mem;
|
||||
use std::thread::{sleep, spawn};
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
use std::mem;
|
||||
use std::thread::{sleep, spawn};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::ptr::null_mut;
|
||||
use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::ptr::null_mut;
|
||||
use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// We want to control preemption here.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
use std::sync::atomic::{fence, AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
// Note: mir-opt-level set to 0 to prevent the read of stack_var in thread 1
|
||||
// from being optimized away and preventing the detection of the data-race.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::thread::spawn;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::thread::{sleep, spawn};
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::thread::spawn;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::thread::spawn;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-preemption-rate=0
|
||||
use std::thread;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
|
||||
use std::thread::spawn;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: Concurrency on Windows is not supported yet.
|
||||
// compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
//@ignore-windows: Concurrency on Windows is not supported yet.
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation -Zmiri-preemption-rate=0
|
||||
|
||||
use std::ptr::null_mut;
|
||||
use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: Windows does not have a global environ list that the program can access directly
|
||||
//@ignore-windows: Windows does not have a global environ list that the program can access directly
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||
fn get_environ() -> *const *const u8 {
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Make sure we detect erroneous constants post-monomorphization even when they are unused.
|
||||
//! (https://github.com/rust-lang/miri/issues/1382)
|
||||
// Inlining changes the error location
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
//@compile-flags: -Zmir-opt-level=0
|
||||
#![feature(never_type)]
|
||||
#![warn(warnings, const_err)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
//@ignore-windows: No libc on Windows
|
||||
//@compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
// FIXME: standard handles cannot be closed (https://github.com/rust-lang/rust/issues/40032)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
// ignore-windows: No libc on Windows
|
||||
//@compile-flags: -Zmiri-disable-isolation
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
// compile-flags: -Zmiri-disable-isolation
|
||||
//@ignore-windows: No libc on Windows
|
||||
//@compile-flags: -Zmiri-disable-isolation
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: no_cache cache fn_ptr
|
||||
//@revisions: no_cache cache fn_ptr
|
||||
|
||||
#[no_mangle]
|
||||
fn foo() {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-disable-abi-check
|
||||
//@compile-flags: -Zmiri-disable-abi-check
|
||||
#![feature(c_unwind)]
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -1,4 +1,4 @@
|
||||
// revisions: extern_block definition both
|
||||
//@revisions: extern_block definition both
|
||||
#![feature(rustc_attrs, c_unwind)]
|
||||
|
||||
#[cfg_attr(any(definition, both), rustc_allocator_nounwind)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let b = Box::new(42);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let g = unsafe { std::mem::transmute::<usize, fn(i32)>(42) };
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
use std::mem;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
#![feature(generators, generator_trait)]
|
||||
|
||||
use std::{
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
#![feature(bench_black_box)]
|
||||
|
||||
fn main() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let c = 0xFFFFFFu32;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Validation makes this fail in the wrong place
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
let i = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() };
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation/SB
|
||||
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
|
||||
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
|
||||
|
||||
fn main() {
|
||||
let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(unreachable_code)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
#![feature(never_type)]
|
||||
#![allow(unused, invalid_value)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-disable-abi-check
|
||||
//@compile-flags: -Zmiri-disable-abi-check
|
||||
// This feature is required to trigger the error using the "C" ABI.
|
||||
#![feature(c_unwind)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Cpanic=abort
|
||||
//@compile-flags: -Cpanic=abort
|
||||
|
||||
//! Unwinding despite `-C panic=abort` is an error.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
|
||||
// Test what happens when we overwrite parts of a pointer.
|
||||
// Also see <https://github.com/rust-lang/miri/issues/2181>.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
#![feature(strict_provenance)]
|
||||
|
||||
use std::mem;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
#![feature(strict_provenance)]
|
||||
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-strict-provenance
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
|
||||
fn main() {
|
||||
let addr = &0 as *const i32 as usize;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This should fail even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
use std::ptr;
|
||||
use std::rc::{Rc, Weak};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// stderr-per-bitwidth
|
||||
//@stderr-per-bitwidth
|
||||
|
||||
fn main() {
|
||||
extern "C" {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
#![feature(strict_provenance)]
|
||||
|
||||
// If we have only exposed read-only pointers, doing a write through a wildcard ptr should fail.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// We *can* have aliasing &RefCell<T> and &mut T, but we cannot read through the former.
|
||||
// Else we couldn't optimize based on the assumption that `xref` below is truly unique.
|
||||
// normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
|
||||
//@normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::{mem, ptr};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Make sure we catch this even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
// Make sure that we cannot load from memory a `&mut` that got already invalidated.
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Make sure we catch this even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
//@compile-flags: -Zmiri-disable-validation
|
||||
|
||||
// Make sure that we cannot load from memory a `&` that got already invalidated.
|
||||
fn main() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// We want to test that granting a SharedReadWrite will be added
|
||||
// *below* an already granted SharedReadWrite -- so writing to
|
||||
// the SharedReadWrite will invalidate the SharedReadWrite.
|
||||
// normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
|
||||
//@normalize-stderr-test: "0x[0-9a-fA-F]+" -> "$$HEX"
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::mem;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-permissive-provenance
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
// Make sure we cannot use raw ptrs to access a local that
|
||||
// we took the direct address of.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Zmiri-strict-provenance
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
//@error-pattern: does not exist in the borrow stack
|
||||
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
|
||||
// compile-flags: -Zmiri-disable-stacked-borrows
|
||||
//@compile-flags: -Zmiri-disable-stacked-borrows
|
||||
|
||||
static X: usize = 5;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
|
||||
// compile-flags: -Zmiri-disable-stacked-borrows
|
||||
//@compile-flags: -Zmiri-disable-stacked-borrows
|
||||
|
||||
use std::mem::transmute;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Stacked Borrows detects that we are casting & to &mut and so it changes why we fail
|
||||
// compile-flags: -Zmiri-disable-stacked-borrows
|
||||
//@compile-flags: -Zmiri-disable-stacked-borrows
|
||||
|
||||
use std::mem::transmute;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
#![feature(rustc_private)]
|
||||
|
||||
/// Test that destroying a pthread_cond twice fails, even without a check for number validity
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
#![feature(rustc_private)]
|
||||
|
||||
/// Test that destroying a pthread_condattr twice fails, even without a check for number validity
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
//
|
||||
// Check that if we pass NULL attribute, then we get the default mutex type.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
//
|
||||
// Check that if we do not set the mutex type, it is the default.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
#![feature(rustc_private)]
|
||||
|
||||
/// Test that destroying a pthread_mutex twice fails, even without a check for number validity
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// ignore-windows: No libc on Windows
|
||||
//@ignore-windows: No libc on Windows
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user