Skip to content

Commit 1b5143a

Browse files
committed
stop using a macro for the mir-opt test suite
1 parent 77dba22 commit 1b5143a

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

src/bootstrap/test.rs

+33-2
Original file line numberDiff line numberDiff line change
@@ -1261,8 +1261,6 @@ default_test!(RunPassValgrind {
12611261
suite: "run-pass-valgrind"
12621262
});
12631263

1264-
default_test!(MirOpt { path: "tests/mir-opt", mode: "mir-opt", suite: "mir-opt" });
1265-
12661264
default_test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen" });
12671265

12681266
default_test!(CodegenUnits {
@@ -1299,6 +1297,39 @@ host_test!(RunMakeFullDeps {
12991297

13001298
default_test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly" });
13011299

1300+
// For the mir-opt suite we do not use macros, as we need custom behavior when blessing.
1301+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1302+
pub struct MirOpt {
1303+
pub compiler: Compiler,
1304+
pub target: TargetSelection,
1305+
}
1306+
1307+
impl Step for MirOpt {
1308+
type Output = ();
1309+
const DEFAULT: bool = true;
1310+
const ONLY_HOSTS: bool = false;
1311+
1312+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1313+
run.suite_path("tests/mir-opt")
1314+
}
1315+
1316+
fn make_run(run: RunConfig<'_>) {
1317+
let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple());
1318+
run.builder.ensure(MirOpt { compiler, target: run.target });
1319+
}
1320+
1321+
fn run(self, builder: &Builder<'_>) {
1322+
builder.ensure(Compiletest {
1323+
compiler: self.compiler,
1324+
target: self.target,
1325+
mode: "mir-opt",
1326+
suite: "mir-opt",
1327+
path: "tests/mir-opt",
1328+
compare_mode: None,
1329+
});
1330+
}
1331+
}
1332+
13021333
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
13031334
struct Compiletest {
13041335
compiler: Compiler,

0 commit comments

Comments
 (0)