@@ -383,7 +383,7 @@ impl<'test> TestCx<'test> {
383383 fn run_cfail_test ( & self ) {
384384 let proc_res = self . compile_test ( ) ;
385385 self . check_if_test_should_compile ( & proc_res) ;
386- self . check_no_compiler_crash ( & proc_res) ;
386+ self . check_no_compiler_crash ( & proc_res, self . props . should_ice ) ;
387387
388388 let output_to_check = self . get_output ( & proc_res) ;
389389 let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
@@ -395,6 +395,12 @@ impl<'test> TestCx<'test> {
395395 } else {
396396 self . check_error_patterns ( & output_to_check, & proc_res) ;
397397 }
398+ if self . props . should_ice {
399+ match proc_res. status . code ( ) {
400+ Some ( 101 ) => ( ) ,
401+ _ => self . fatal ( "expected ICE" ) ,
402+ }
403+ }
398404
399405 self . check_forbid_output ( & output_to_check, & proc_res) ;
400406 }
@@ -1402,9 +1408,9 @@ impl<'test> TestCx<'test> {
14021408 }
14031409 }
14041410
1405- fn check_no_compiler_crash ( & self , proc_res : & ProcRes ) {
1411+ fn check_no_compiler_crash ( & self , proc_res : & ProcRes , should_ice : bool ) {
14061412 match proc_res. status . code ( ) {
1407- Some ( 101 ) => self . fatal_proc_rec ( "compiler encountered internal error" , proc_res) ,
1413+ Some ( 101 ) if !should_ice => self . fatal_proc_rec ( "compiler encountered internal error" , proc_res) ,
14081414 None => self . fatal_proc_rec ( "compiler terminated by signal" , proc_res) ,
14091415 _ => ( ) ,
14101416 }
@@ -2518,7 +2524,7 @@ impl<'test> TestCx<'test> {
25182524 self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
25192525 }
25202526
2521- self . check_no_compiler_crash ( & proc_res) ;
2527+ self . check_no_compiler_crash ( & proc_res, self . props . should_ice ) ;
25222528
25232529 const PREFIX : & ' static str = "MONO_ITEM " ;
25242530 const CGU_MARKER : & ' static str = "@@" ;
0 commit comments