Auto merge of #71444 - RalfJung:test-async-no-opt, r=jonas-schievink
smoke-test for async fn with mir-opt-level=0 MIR opt levels heavily influence which MIR transformations run, and we barely test non-default opt levels. I am particularly worried about `async fn` lowering and how it might (not) work when the set of preceding MIR passes changes -- see https://github.com/rust-lang/rust/pull/70073. This adds some basic smoke testing, where at least a few `async fn` `run-pass` test are ensured to also work with mir-opt-level=0.
This commit is contained in:
commit
d7afaa7247
10 changed files with 30 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![allow(unused)]
|
||||
|
||||
// edition:2018
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
// edition:2018
|
||||
// aux-build:arc_wake.rs
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// edition:2018
|
||||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![allow(unused_variables)]
|
||||
|
||||
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// edition:2018
|
||||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![allow(unused_variables)]
|
||||
|
||||
// Test the drop order for parameters relative to local variables and
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// edition:2018
|
||||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
|
||||
// parameters (used or unused) are not dropped until the async fn is cancelled.
|
||||
// This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![feature(generators, generator_trait)]
|
||||
|
||||
use std::ops::Generator;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![feature(generators, generator_trait)]
|
||||
|
||||
use std::marker::Unpin;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![feature(generators, generator_trait)]
|
||||
|
||||
use std::ops::Generator;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
#![feature(generators, generator_trait)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// run-pass
|
||||
|
||||
// revisions: default nomiropt
|
||||
//[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||
|
||||
// ignore-emscripten no threads support
|
||||
// compile-flags: --test
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue