@@ -383,7 +383,7 @@ impl<'test> TestCx<'test> {
383
383
fn run_cfail_test ( & self ) {
384
384
let proc_res = self . compile_test ( ) ;
385
385
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 ) ;
387
387
388
388
let output_to_check = self . get_output ( & proc_res) ;
389
389
let expected_errors = errors:: load_errors ( & self . testpaths . file , self . revision ) ;
@@ -395,6 +395,12 @@ impl<'test> TestCx<'test> {
395
395
} else {
396
396
self . check_error_patterns ( & output_to_check, & proc_res) ;
397
397
}
398
+ if self . props . should_ice {
399
+ match proc_res. status . code ( ) {
400
+ Some ( 101 ) => ( ) ,
401
+ _ => self . fatal ( "expected ICE" ) ,
402
+ }
403
+ }
398
404
399
405
self . check_forbid_output ( & output_to_check, & proc_res) ;
400
406
}
@@ -1402,9 +1408,9 @@ impl<'test> TestCx<'test> {
1402
1408
}
1403
1409
}
1404
1410
1405
- fn check_no_compiler_crash ( & self , proc_res : & ProcRes ) {
1411
+ fn check_no_compiler_crash ( & self , proc_res : & ProcRes , should_ice : bool ) {
1406
1412
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) ,
1408
1414
None => self . fatal_proc_rec ( "compiler terminated by signal" , proc_res) ,
1409
1415
_ => ( ) ,
1410
1416
}
@@ -2518,7 +2524,7 @@ impl<'test> TestCx<'test> {
2518
2524
self . fatal_proc_rec ( "compilation failed!" , & proc_res) ;
2519
2525
}
2520
2526
2521
- self . check_no_compiler_crash ( & proc_res) ;
2527
+ self . check_no_compiler_crash ( & proc_res, self . props . should_ice ) ;
2522
2528
2523
2529
const PREFIX : & ' static str = "MONO_ITEM " ;
2524
2530
const CGU_MARKER : & ' static str = "@@" ;
0 commit comments