mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Bump mir-opt-level from 2 to 3 in tests
This commit is contained in:
parent
705813c84b
commit
af63afc09a
@ -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"]
|
||||
|
||||
|
@ -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)]
|
||||
|
@ -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`.
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
// build-fail
|
||||
// compile-flags: -Zmir-opt-level=2
|
||||
// compile-flags: -Zmir-opt-level=3
|
||||
|
||||
#![deny(warnings)]
|
||||
|
||||
|
@ -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)]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// run-pass
|
||||
|
||||
struct Baz<T: ?Sized> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// run-pass
|
||||
|
||||
use std::cell::Cell;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// run-pass
|
||||
|
||||
fn e220() -> (i64, i64) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"]
|
||||
|
@ -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];
|
||||
|
@ -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 {
|
||||
|
@ -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) }
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// edition:2018
|
||||
// build-pass
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
//
|
||||
// check-pass
|
||||
// edition:2018
|
||||
// compile-args: -Zmir-opt-level=2
|
||||
// compile-args: -Zmir-opt-level=3
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -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)]
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// build-pass
|
||||
|
||||
use std::fs::File;
|
||||
|
@ -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> {
|
||||
|
@ -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
|
||||
|
@ -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]);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-pass
|
||||
// compile-flags:-Zmir-opt-level=2
|
||||
// compile-flags:-Zmir-opt-level=3
|
||||
|
||||
trait Array {
|
||||
type Item;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-pass
|
||||
// compile-flags:-Zmir-opt-level=2
|
||||
// compile-flags:-Zmir-opt-level=3
|
||||
|
||||
pub enum Enum {
|
||||
A,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-pass
|
||||
// compile-flags:-Zmir-opt-level=2
|
||||
// compile-flags:-Zmir-opt-level=3
|
||||
|
||||
struct Cursor {}
|
||||
struct TokenTree {}
|
||||
|
@ -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;
|
||||
|
@ -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() {}
|
||||
|
||||
|
@ -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 }
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -Z mir-opt-level=2
|
||||
// compile-flags: -Z mir-opt-level=3
|
||||
// build-pass
|
||||
#![crate_type="lib"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user