@@ -357,14 +357,15 @@ impl<'test> TestCx<'test> {
357
357
Ui if pm == Some ( PassMode :: Run ) || self . props . fail_mode == Some ( FailMode :: Run ) => {
358
358
WillExecute :: Yes
359
359
}
360
- Ui => WillExecute :: No ,
360
+ MirOpt if pm == Some ( PassMode :: Run ) => WillExecute :: Yes ,
361
+ Ui | MirOpt => WillExecute :: No ,
361
362
mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
362
363
}
363
364
}
364
365
365
366
fn should_run_successfully ( & self , pm : Option < PassMode > ) -> bool {
366
367
match self . config . mode {
367
- Ui => pm == Some ( PassMode :: Run ) ,
368
+ Ui | MirOpt => pm == Some ( PassMode :: Run ) ,
368
369
mode => panic ! ( "unimplemented for mode {:?}" , mode) ,
369
370
}
370
371
}
@@ -3057,18 +3058,24 @@ impl<'test> TestCx<'test> {
3057
3058
}
3058
3059
3059
3060
fn run_mir_opt_test ( & self ) {
3060
- let proc_res = self . compile_test ( WillExecute :: Yes , EmitMetadata :: No ) ;
3061
+ let pm = self . pass_mode ( ) ;
3062
+ let should_run = self . should_run ( pm) ;
3063
+ let emit_metadata = self . should_emit_metadata ( pm) ;
3064
+ let proc_res = self . compile_test ( should_run, emit_metadata) ;
3061
3065
3062
3066
if !proc_res. status . success ( ) {
3063
3067
self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
3064
3068
}
3065
3069
3066
- let proc_res = self . exec_compiled_test ( ) ;
3070
+ self . check_mir_dump ( ) ;
3067
3071
3068
- if !proc_res. status . success ( ) {
3069
- self . fatal_proc_rec ( "test run failed!" , & proc_res) ;
3072
+ if let WillExecute :: Yes = should_run {
3073
+ let proc_res = self . exec_compiled_test ( ) ;
3074
+
3075
+ if !proc_res. status . success ( ) {
3076
+ self . fatal_proc_rec ( "test run failed!" , & proc_res) ;
3077
+ }
3070
3078
}
3071
- self . check_mir_dump ( ) ;
3072
3079
}
3073
3080
3074
3081
fn check_mir_dump ( & self ) {
0 commit comments