Skip to content

Commit 1580046

Browse files
committed
Fix const_fn_mir
1 parent f797c92 commit 1580046

File tree

4 files changed

+11
-27
lines changed

4 files changed

+11
-27
lines changed

tests/run-make/const_fn_mir/dump.mir

-13
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,3 @@ fn foo() -> i32 {
2424
return;
2525
}
2626
}
27-
28-
fn main() -> () {
29-
let mut _0: ();
30-
let _1: i32;
31-
32-
bb0: {
33-
_1 = foo() -> [return: bb1, unwind continue];
34-
}
35-
36-
bb1: {
37-
return;
38-
}
39-
}

tests/run-make/const_fn_mir/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// emit-mir
2+
//@ check-pass
3+
4+
#![crate_type = "lib"]
5+
6+
pub const fn foo() -> i32 {
7+
5 + 6
8+
}

tests/run-make/const_fn_mir/main.rs

-10
This file was deleted.

tests/run-make/const_fn_mir/rmake.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// The `needs-unwind -Cpanic=abort` gives a different MIR output.
2-
3-
//@ needs-unwind
1+
//! This test is supposed to check that --emit=mir emits both optimized_mir and mir_for_ctfe for a
2+
//! const fn.
43
54
use run_make_support::{diff, rustc};
65

76
fn main() {
8-
rustc().input("main.rs").emit("mir").output("dump-actual.mir").run();
7+
rustc().input("lib.rs").emit("mir").output("dump-actual.mir").run();
98
diff().expected_file("dump.mir").actual_file("dump-actual.mir").run();
109
}

0 commit comments

Comments
 (0)