Skip to content

Commit e01d941

Browse files
committed
check for sould-ice either in compilefail or incremental cfail
1 parent 5852a3f commit e01d941

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tools/compiletest/src/runtest.rs

+12
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ impl<'test> TestCx<'test> {
298298
/// Code executed for each revision in turn (or, if there are no
299299
/// revisions, exactly once, with revision == None).
300300
fn run_revision(&self) {
301+
if self.props.should_ice {
302+
if self.config.mode != CompileFail &&
303+
self.config.mode != Incremental {
304+
self.fatal("cannot use should-ice in a test that is not cfail");
305+
}
306+
}
301307
match self.config.mode {
302308
CompileFail => self.run_cfail_test(),
303309
RunFail => self.run_rfail_test(),
@@ -2782,8 +2788,14 @@ impl<'test> TestCx<'test> {
27822788
}
27832789

27842790
if revision.starts_with("rpass") {
2791+
if revision_cx.props.should_ice {
2792+
revision_cx.fatal("can only use should-ice in cfail tests");
2793+
}
27852794
revision_cx.run_rpass_test();
27862795
} else if revision.starts_with("rfail") {
2796+
if revision_cx.props.should_ice {
2797+
revision_cx.fatal("can only use should-ice in cfail tests");
2798+
}
27872799
revision_cx.run_rfail_test();
27882800
} else if revision.starts_with("cfail") {
27892801
revision_cx.run_cfail_test();

0 commit comments

Comments
 (0)