From 9ea5eed32b797ae0c4846e6d2efb9899777b55fc Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 22 Apr 2020 23:03:37 +0200 Subject: [PATCH 1/2] smoke-test for async fn with mir-opt-level=0 --- src/test/ui/async-await/async-await.rs | 3 +++ src/test/ui/async-await/async-closure.rs | 3 +++ .../drop-order/drop-order-for-async-fn-parameters.rs | 3 +++ .../drop-order/drop-order-for-temporary-in-tail-return-expr.rs | 3 +++ .../ui/async-await/drop-order/drop-order-when-cancelled.rs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/test/ui/async-await/async-await.rs b/src/test/ui/async-await/async-await.rs index 1dc7315e88c..0207752afe0 100644 --- a/src/test/ui/async-await/async-await.rs +++ b/src/test/ui/async-await/async-await.rs @@ -1,5 +1,8 @@ // run-pass +// revisions: default nomiropt +//[nomiropt]compile-flags: -Z mir-opt-level=0 + #![allow(unused)] // edition:2018 diff --git a/src/test/ui/async-await/async-closure.rs b/src/test/ui/async-await/async-closure.rs index 9a24bd8c954..12d66b19e07 100644 --- a/src/test/ui/async-await/async-closure.rs +++ b/src/test/ui/async-await/async-closure.rs @@ -1,5 +1,8 @@ // run-pass +// revisions: default nomiropt +//[nomiropt]compile-flags: -Z mir-opt-level=0 + // edition:2018 // aux-build:arc_wake.rs diff --git a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs index 00072786a50..6c10ead3690 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.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 diff --git a/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs b/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs index e40acff6dc1..4ec43708584 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs @@ -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 diff --git a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs index 9e8304935bf..cfd68bc0d23 100644 --- a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs +++ b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs @@ -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 From 3a129df39cb1744740bbed3effd4dbe4f79a59d8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 28 Apr 2020 08:22:08 +0200 Subject: [PATCH 2/2] also run some generator tests without MIR optimizations --- src/test/ui/generator/conditional-drop.rs | 3 +++ src/test/ui/generator/control-flow.rs | 3 +++ src/test/ui/generator/drop-env.rs | 3 +++ src/test/ui/generator/smoke-resume-args.rs | 3 +++ src/test/ui/generator/smoke.rs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/test/ui/generator/conditional-drop.rs b/src/test/ui/generator/conditional-drop.rs index 990d94e6efc..0927df86927 100644 --- a/src/test/ui/generator/conditional-drop.rs +++ b/src/test/ui/generator/conditional-drop.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; diff --git a/src/test/ui/generator/control-flow.rs b/src/test/ui/generator/control-flow.rs index 9d4c217b76e..4f69c785560 100644 --- a/src/test/ui/generator/control-flow.rs +++ b/src/test/ui/generator/control-flow.rs @@ -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; diff --git a/src/test/ui/generator/drop-env.rs b/src/test/ui/generator/drop-env.rs index 7ba71188104..66dfb8c2c09 100644 --- a/src/test/ui/generator/drop-env.rs +++ b/src/test/ui/generator/drop-env.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; diff --git a/src/test/ui/generator/smoke-resume-args.rs b/src/test/ui/generator/smoke-resume-args.rs index 32f3ee32d77..fa9271c538f 100644 --- a/src/test/ui/generator/smoke-resume-args.rs +++ b/src/test/ui/generator/smoke-resume-args.rs @@ -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; diff --git a/src/test/ui/generator/smoke.rs b/src/test/ui/generator/smoke.rs index 9289710b34b..7a917a05dd9 100644 --- a/src/test/ui/generator/smoke.rs +++ b/src/test/ui/generator/smoke.rs @@ -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