mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
TB: select tests to run both TB and SB
This commit is contained in:
parent
e243206ae3
commit
782b869224
@ -139,8 +139,9 @@ regexes! {
|
||||
STDOUT:
|
||||
// Windows file paths
|
||||
r"\\" => "/",
|
||||
// erase Stacked Borrows tags
|
||||
// erase borrow tags
|
||||
"<[0-9]+>" => "<TAG>",
|
||||
"<[0-9]+=" => "<TAG=",
|
||||
}
|
||||
|
||||
regexes! {
|
||||
@ -149,8 +150,9 @@ regexes! {
|
||||
r"\.rs:[0-9]+:[0-9]+(: [0-9]+:[0-9]+)?" => ".rs:LL:CC",
|
||||
// erase alloc ids
|
||||
"alloc[0-9]+" => "ALLOC",
|
||||
// erase Stacked Borrows tags
|
||||
// erase borrow tags
|
||||
"<[0-9]+>" => "<TAG>",
|
||||
"<[0-9]+=" => "<TAG=",
|
||||
// erase whitespace that differs between platforms
|
||||
r" +at (.*\.rs)" => " at $1",
|
||||
// erase generics in backtraces
|
||||
|
@ -1,4 +1,4 @@
|
||||
//! Make sure that a retag acts like a write for the data race model.
|
||||
//! Make sure that a retag acts like a read for the data race model.
|
||||
//@compile-flags: -Zmiri-preemption-rate=0
|
||||
#[derive(Copy, Clone)]
|
||||
struct SendPtr(*mut u8);
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
fn ensure_allocs_can_be_adjacent() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
trait Foo {
|
||||
const ID: i32;
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
fn main() {
|
||||
vec![()].into_iter();
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
#![feature(strict_provenance, strict_provenance_atomic_ptr)]
|
||||
use std::sync::atomic::{
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
fn main() {
|
||||
assert_eq!(std::thread::available_parallelism().unwrap().get(), 1);
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![allow(incomplete_features)] // for trait upcasting
|
||||
#![feature(allocator_api, trait_upcasting)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows -Zmiri-permissive-provenance
|
||||
#![feature(ptr_internals)]
|
||||
|
||||
fn main() {
|
||||
|
3
src/tools/miri/tests/pass/box.tree.stdout
Normal file
3
src/tools/miri/tests/pass/box.tree.stdout
Normal file
@ -0,0 +1,3 @@
|
||||
pair_foo = PairFoo { fst: Foo(42), snd: Foo(1337) }
|
||||
foo #0 = Foo(42)
|
||||
foo #1 = Foo(1337)
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
#![feature(btree_drain_filter)]
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
// Check that you can cast between different pointers to trait objects
|
||||
// whose vtable have the same kind (both lengths, or both trait pointers).
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
|
||||
use std::sync::mpsc::{channel, sync_channel};
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-disable-isolation -Zmiri-strict-provenance
|
||||
|
||||
use std::sync::{Arc, Barrier, Condvar, Mutex, Once, RwLock};
|
||||
|
20
src/tools/miri/tests/pass/concurrency/sync.tree.stdout
Normal file
20
src/tools/miri/tests/pass/concurrency/sync.tree.stdout
Normal file
@ -0,0 +1,20 @@
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
before wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
||||
after wait
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
|
||||
//! The main purpose of this test is to check that if we take a pointer to
|
||||
|
@ -1,3 +1,6 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::thread;
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
Dropping: 8 (should be before 'Continue main 1').
|
||||
Dropping: 8 (should be before 'Continue main 1').
|
||||
Continue main 1.
|
||||
Joining: 7 (should be before 'Continue main 2').
|
||||
Continue main 2.
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-disable-alignment-check
|
||||
|
||||
fn main() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows -Zmiri-permissive-provenance
|
||||
#![feature(extern_types)]
|
||||
|
||||
extern "C" {
|
||||
|
@ -1,3 +1,6 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
|
||||
use std::future::*;
|
||||
use std::marker::PhantomPinned;
|
||||
use std::pin::*;
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(generators, generator_trait, never_type)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
use std::collections::HashMap;
|
||||
use std::hash::BuildHasher;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
|
||||
use std::mem;
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(linked_list_cursors)]
|
||||
use std::collections::LinkedList;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
// Make sure validation can handle many overlapping shared borrows for different parts of a data structure
|
||||
use std::cell::RefCell;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-ignore-leaks
|
||||
|
||||
fn main() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
// This tests that the size of Option<Box<i32>> is the same as *const i32.
|
||||
fn option_box_deref() -> i32 {
|
||||
let val = Some(Box::new(42));
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
#![feature(ptr_metadata, const_raw_ptr_comparison)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(strict_provenance)]
|
||||
#![feature(pointer_byte_offsets)]
|
||||
use std::{mem, ptr};
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-permissive-provenance
|
||||
#![feature(strict_provenance)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
// Test what happens when we read parts of a pointer.
|
||||
// Related to <https://github.com/rust-lang/rust/issues/69488>.
|
||||
fn ptr_partial_read() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
#![feature(new_uninit)]
|
||||
#![feature(get_mut_unchecked)]
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
use std::sync::Mutex;
|
||||
|
||||
fn par_for<I, F>(iter: I, f: F)
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
#![feature(new_uninit)]
|
||||
#![feature(slice_as_chunks)]
|
||||
|
@ -7,7 +7,7 @@ use std::{
|
||||
|
||||
extern "Rust" {
|
||||
fn miri_get_alloc_id(ptr: *const u8) -> u64;
|
||||
fn miri_print_borrow_stacks(alloc_id: u64);
|
||||
fn miri_print_borrow_state(alloc_id: u64, show_unnamed: bool);
|
||||
}
|
||||
|
||||
fn get_alloc_id(ptr: *const u8) -> u64 {
|
||||
@ -15,7 +15,9 @@ fn get_alloc_id(ptr: *const u8) -> u64 {
|
||||
}
|
||||
|
||||
fn print_borrow_stacks(alloc_id: u64) {
|
||||
unsafe { miri_print_borrow_stacks(alloc_id) }
|
||||
unsafe {
|
||||
miri_print_borrow_state(alloc_id, /* ignored: show_unnamed */ false)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-ignore-leaks
|
||||
|
||||
//! Test that leaking threads works, and that their destructors are not executed.
|
||||
|
1
src/tools/miri/tests/pass/threadleak_ignored.tree.stderr
Normal file
1
src/tools/miri/tests/pass/threadleak_ignored.tree.stderr
Normal file
@ -0,0 +1 @@
|
||||
Dropping 0
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(strict_provenance)]
|
||||
use std::{mem, ptr};
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
#![feature(unsized_tuple_coercion)]
|
||||
#![feature(unsized_fn_params)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
#![feature(iter_advance_by, iter_next_chunk)]
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//@revisions: stack tree
|
||||
//@[tree]compile-flags: -Zmiri-tree-borrows
|
||||
//@compile-flags: -Zmiri-strict-provenance
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
2
src/tools/miri/tests/pass/vecdeque.tree.stdout
Normal file
2
src/tools/miri/tests/pass/vecdeque.tree.stdout
Normal file
@ -0,0 +1,2 @@
|
||||
[2, 2] Iter([2, 2], [])
|
||||
Iter([], [])
|
Loading…
Reference in New Issue
Block a user