Skip to content

Commit

Permalink
Bump mir-opt-level from 2 to 3 in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Mar 4, 2021
1 parent 0f9fdba commit 0550a6f
Show file tree
Hide file tree
Showing 39 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/test/codegen/issue-59352.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// Once the optimizer can do that, mir-opt/issues/issue-59352.rs will need to be updated and this
// test case should be removed as it will become redundant.

// mir-opt-level=2 enables inlining and enables LLVM to optimize away the unreachable panic call.
// compile-flags: -O -Z mir-opt-level=2
// mir-opt-level=3 enables inlining and enables LLVM to optimize away the unreachable panic call.
// compile-flags: -O -Z mir-opt-level=3

#![crate_type = "rlib"]

Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/naked-noinline.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Checks that naked functions are never inlined.
// compile-flags: -O -Zmir-opt-level=2
// compile-flags: -O -Zmir-opt-level=3
// ignore-wasm32
#![crate_type = "lib"]
#![feature(asm)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/try_identity.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -C no-prepopulate-passes -O -Z mir-opt-level=2 -Zunsound-mir-opts
// compile-flags: -C no-prepopulate-passes -O -Z mir-opt-level=3 -Zunsound-mir-opts

// Ensure that `x?` has no overhead on `Result<T, E>` due to identity `match`es in lowering.
// This requires inlining to trigger the MIR optimizations in `SimplifyArmIdentity`.
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/const_prop/issue-66971.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3

// Due to a bug in propagating scalar pairs the assertion below used to fail. In the expected
// outputs below, after ConstProp this is how _2 would look like with the bug:
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/const_prop/issue-67019.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3

// This used to ICE in const-prop

Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/issues/issue-59352.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// removed.

// EMIT_MIR issue_59352.num_to_digit.PreCodegen.after.mir
// compile-flags: -Z mir-opt-level=2 -Z span_free_formats
// compile-flags: -Z mir-opt-level=3 -Z span_free_formats

pub fn num_to_digit(num: char) -> u32 {
// CHECK-NOT: panic
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/simplify-arm-identity.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Checks that `SimplifyArmIdentity` is not applied if enums have incompatible layouts.
// Regression test for issue #66856.
//
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3
// EMIT_MIR_FOR_EACH_BIT_WIDTH

enum Src {
Expand Down
2 changes: 1 addition & 1 deletion src/test/mir-opt/simplify-arm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2 -Zunsound-mir-opts
// compile-flags: -Z mir-opt-level=3 -Zunsound-mir-opts
// EMIT_MIR simplify_arm.id.SimplifyArmIdentity.diff
// EMIT_MIR simplify_arm.id.SimplifyBranchSame.diff
// EMIT_MIR simplify_arm.id_result.SimplifyArmIdentity.diff
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const_prop/inline_spans.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// build-fail
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3

#![deny(warnings)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/const_prop/inline_spans_lint_attribute.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Must be build-pass, because check-pass will not run const prop and thus not emit the lint anyway.
// build-pass
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3

#![deny(warnings)]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-67529.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// run-pass

struct Baz<T: ?Sized> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-67641.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// run-pass

use std::cell::Cell;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-67862.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// run-pass

fn e220() -> (i64, i64) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/trait_specialization.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ignore-wasm32-bare which doesn't support `std::process:exit()`
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3
// run-pass

// Tests that specialization does not cause optimizations running on polymorphic MIR to resolve
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/dest-prop/skeptic-miscompile.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-pass

// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3

trait IterExt: Iterator {
fn fold_ex<B, F>(mut self, init: B, mut f: F) -> B
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// revisions: default miropt
//[miropt]compile-flags: -Z mir-opt-level=2
//[miropt]compile-flags: -Z mir-opt-level=3
// ~^ This flag is for #77668, it used to be ICE.

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-77002.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Zmir-opt-level=2 -Copt-level=0
// compile-flags: -Zmir-opt-level=3 -Copt-level=0
// run-pass

type M = [i64; 2];
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/auxiliary/issue_76375_aux.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// edition:2018
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3

#[inline(always)]
pub fn copy_prop(s: bool) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-66851.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// did not check that the types matched up in the `Ok(r)` branch.
//
// run-pass
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3

#[derive(Debug, PartialEq, Eq)]
enum SpecialsRes { Res(u64) }
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-67710-inline-projection.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// build-pass

// This used to ICE due to the inling pass not examining projections
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-68841.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// edition:2018
// build-pass

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-71793-inline-args-storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// check-pass
// edition:2018
// compile-args: -Zmir-opt-level=2
// compile-args: -Zmir-opt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-75053.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// build-pass

#![feature(type_alias_impl_trait)]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-76248.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Regression test for #76248.
//
// build-pass
// compile-flags: -Zmir-opt-level=2
// compile-flags: -Zmir-opt-level=3

const N: usize = 1;

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-76375.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// edition:2018
// build-pass
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// aux-build:issue_76375_aux.rs

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-77911.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// build-pass

use std::fs::File;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue-78496.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags: -Z mir-opt-level=2 -C opt-level=0
// compile-flags: -Z mir-opt-level=3 -C opt-level=0

// example from #78496
pub enum E<'a> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/issue66339.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// build-pass

// This used to ICE in const-prop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Regression test for issue #79269.
//
// build-pass
// compile-flags: -Zmir-opt-level=2 -Zvalidate-mir
// compile-flags: -Zmir-opt-level=3 -Zvalidate-mir
#[derive(Clone)]
struct Array<T, const N: usize>([T; N]);

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-45493.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3

trait Array {
type Item;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-45885.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3

pub enum Enum {
A,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-68347.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3
pub fn main() {
let _x: fn() = handle_debug_column;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-77306-1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3

// Previously ICEd because we did not normalize during inlining,
// see https://github.com/rust-lang/rust/pull/77306 for more discussion.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-77306-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3

struct Cursor {}
struct TokenTree {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/ice-issue-77564.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3

use std::mem::MaybeUninit;
const N: usize = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Ensures -Zmir-opt-level=2 (specifically, inlining) is not allowed with -Zinstrument-coverage.
// Ensures -Zmir-opt-level=3 (specifically, inlining) is not allowed with -Zinstrument-coverage.
// Regression test for issue #80060.
//
// needs-profiler-support
// build-pass
// compile-flags: -Zmir-opt-level=2 -Zinstrument-coverage
// compile-flags: -Zmir-opt-level=3 -Zinstrument-coverage
#[inline(never)]
fn foo() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags:-Zmir-opt-level=2
// compile-flags:-Zmir-opt-level=3
pub trait Foo {
fn bar(&self) -> usize { 2 }
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir-inlining/var-debuginfo-issue-67586.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
// compile-flags: -Z mir-opt-level=2 -C opt-level=0 -C debuginfo=2
// compile-flags: -Z mir-opt-level=3 -C opt-level=0 -C debuginfo=2

#[inline(never)]
pub fn foo(bar: usize) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/mir/mir_const_prop_tuple_field_reorder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: -Z mir-opt-level=2
// compile-flags: -Z mir-opt-level=3
// build-pass
#![crate_type="lib"]

Expand Down

0 comments on commit 0550a6f

Please sign in to comment.