Skip to content

Commit 2116ed7

Browse files
committed
Tweak a few mir-opt tests instead of using -Clink-dead-code
1 parent 4451bf4 commit 2116ed7

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/bootstrap/src/core/build_steps/test.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,6 @@ impl Step for MirOpt {
14701470
};
14711471

14721472
if builder.config.cmd.bless() {
1473-
crate::utils::cc_detect::find_target(builder, self.compiler.host);
14741473
// All that we really need to do is cover all combinations of 32/64-bit and unwind/abort,
14751474
// but while we're at it we might as well flex our cross-compilation support. This
14761475
// selection covers all our tier 1 operating systems and architectures using only tier

src/tools/compiletest/src/runtest.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,6 @@ impl<'test> TestCx<'test> {
24682468
"-Zlint-mir",
24692469
"-Zdump-mir-exclude-pass-number",
24702470
"--crate-type=rlib",
2471-
"-Clink-dead-code",
24722471
]);
24732472
if let Some(pass) = &self.props.mir_unit_test {
24742473
rustc.args(&["-Zmir-opt-level=0", &format!("-Zmir-enable-passes=+{}", pass)]);

tests/mir-opt/fn_ptr_shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// (as only `FnDef` and `FnPtr` callees are allowed in MIR).
66

77
// EMIT_MIR core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
8-
fn main() {
8+
pub fn main() {
99
call(noop as fn());
1010
}
1111

tests/mir-opt/retag.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl Drop for Test {
2828

2929
// EMIT_MIR retag.main.SimplifyCfg-elaborate-drops.after.mir
3030
// EMIT_MIR retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
31-
fn main() {
31+
pub fn main() {
3232
let mut x = 0;
3333
{
3434
let v = Test(0).foo(&mut x); // just making sure we do not panic when there is a tuple struct ctor

tests/mir-opt/slice_drop_shim.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// skip-filecheck
2-
// compile-flags: -Zmir-opt-level=0
3-
2+
// compile-flags: -Zmir-opt-level=0 -Clink-dead-code
3+
// mir-opt tests are always built as rlibs so that they seamlessly cross-compile,
4+
// so this test only produces MIR for the drop_in_place we're looking for
5+
// if we use -Clink-dead-code.
46

57
// EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
68
fn main() {

tests/mir-opt/unusual_item_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ enum E {
2323
V = 5,
2424
}
2525

26-
fn main() {
26+
pub fn main() {
2727
let f = Test::X as fn(usize) -> Test;
2828
// EMIT_MIR core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
2929
let v = Vec::<i32>::new();

0 commit comments

Comments
 (0)