Skip to content

Commit

Permalink
Tweak a few mir-opt tests instead of using -Clink-dead-code
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Jan 31, 2024
1 parent 9099c94 commit 815d312
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,6 @@ impl Step for MirOpt {
};

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
Expand Down
1 change: 0 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,6 @@ impl<'test> TestCx<'test> {
"-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)]);
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/fn_ptr_shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/retag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Drop for Test {

// 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
Expand Down
6 changes: 4 additions & 2 deletions tests/mir-opt/slice_drop_shim.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/unusual_item_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 815d312

Please sign in to comment.