Tweak a few mir-opt tests instead of using -Clink-dead-code
This commit is contained in:
parent
4451bf4d67
commit
2116ed723d
@ -1470,7 +1470,6 @@ fn run(self, builder: &Builder<'_>) {
|
||||
};
|
||||
|
||||
if builder.config.cmd.bless() {
|
||||
crate::utils::cc_detect::find_target(builder, self.compiler.host);
|
||||
// All that we really need to do is cover all combinations of 32/64-bit and unwind/abort,
|
||||
// but while we're at it we might as well flex our cross-compilation support. This
|
||||
// selection covers all our tier 1 operating systems and architectures using only tier
|
||||
|
@ -2468,7 +2468,6 @@ fn make_compile_args(
|
||||
"-Zlint-mir",
|
||||
"-Zdump-mir-exclude-pass-number",
|
||||
"--crate-type=rlib",
|
||||
"-Clink-dead-code",
|
||||
]);
|
||||
if let Some(pass) = &self.props.mir_unit_test {
|
||||
rustc.args(&["-Zmir-opt-level=0", &format!("-Zmir-enable-passes=+{}", pass)]);
|
||||
|
@ -5,7 +5,7 @@
|
||||
// (as only `FnDef` and `FnPtr` callees are allowed in MIR).
|
||||
|
||||
// EMIT_MIR core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
call(noop as fn());
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ fn drop(&mut self) {}
|
||||
|
||||
// EMIT_MIR retag.main.SimplifyCfg-elaborate-drops.after.mir
|
||||
// EMIT_MIR retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
let mut x = 0;
|
||||
{
|
||||
let v = Test(0).foo(&mut x); // just making sure we do not panic when there is a tuple struct ctor
|
||||
|
@ -1,6 +1,8 @@
|
||||
// skip-filecheck
|
||||
// compile-flags: -Zmir-opt-level=0
|
||||
|
||||
// compile-flags: -Zmir-opt-level=0 -Clink-dead-code
|
||||
// mir-opt tests are always built as rlibs so that they seamlessly cross-compile,
|
||||
// so this test only produces MIR for the drop_in_place we're looking for
|
||||
// if we use -Clink-dead-code.
|
||||
|
||||
// EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
|
||||
fn main() {
|
||||
|
@ -23,7 +23,7 @@ enum E {
|
||||
V = 5,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
let f = Test::X as fn(usize) -> Test;
|
||||
// EMIT_MIR core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
|
||||
let v = Vec::<i32>::new();
|
||||
|
Loading…
Reference in New Issue
Block a user