disable MIR opts for ZST-related tests
This commit is contained in:
parent
726495f489
commit
585e51aabd
8 changed files with 22 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
// Make sure we find these even with many checks disabled.
|
||||
// compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
// 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
|
||||
|
||||
fn main() {
|
||||
let p = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// This pointer *could* be NULL so we cannot load from it, not even at ZST
|
||||
let ptr = (&0u8 as *const u8).wrapping_sub(0x800) as *const ();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// This pointer *could* be NULL so we cannot load from it, not even at ZST.
|
||||
// Not using the () type here, as writes of that type do not even have MIR generated.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
let x: () = unsafe { *std::ptr::null() }; //~ ERROR memory access failed: 0x0 is not a valid pointer
|
||||
panic!("this should never print: {:?}", x);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// Not using the () type here, as writes of that type do not even have MIR generated.
|
||||
// Also not assigning directly as that's array initialization, not assignment.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// This should fail even without validation
|
||||
// compile-flags: -Zmiri-disable-validation
|
||||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0 -Zmiri-disable-validation
|
||||
|
||||
fn main() {
|
||||
for i in 0..10 { // Try many times as this might work by chance.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// Not using the () type here, as writes of that type do not even have MIR generated.
|
||||
// Also not assigning directly as that's array initialization, not assignment.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Some optimizations remove ZST accesses, thus masking this UB.
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
fn main() {
|
||||
// Not using the () type here, as writes of that type do not even have MIR generated.
|
||||
// Also not assigning directly as that's array initialization, not assignment.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue