@@ -92,6 +92,40 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
9292 TestCase :: build_bin_and_run ( "aot.neon" , "example/neon.rs" , & [ ] ) ,
9393 TestCase :: build_bin_and_run ( "aot.gen_block_iterate" , "example/gen_block_iterate.rs" , & [ ] ) ,
9494 TestCase :: build_bin_and_run ( "aot.raw-dylib" , "example/raw-dylib.rs" , & [ ] ) ,
95+ TestCase :: custom ( "aot.large-byval-align" , & |runner| {
96+ if !runner. target_compiler . triple . starts_with ( "x86_64-" )
97+ || runner. target_compiler . triple . contains ( "windows" )
98+ {
99+ eprintln ! (
100+ "Skipping large-byval-align: target {} does not hit the backend limit" ,
101+ runner. target_compiler. triple
102+ ) ;
103+ return ;
104+ }
105+
106+ let output = runner
107+ . rustc_command ( [ "example/large-byval-align.rs" , "--crate-type" , "lib" , "-Copt-level=0" ] )
108+ . output ( )
109+ . expect ( "failed to run rustc" ) ;
110+ assert ! (
111+ !output. status. success( ) ,
112+ "expected large-byval-align.rs to exceed a backend implementation limit"
113+ ) ;
114+
115+ let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
116+ assert ! (
117+ stderr. contains( "backend implementation limit exceeded" ) ,
118+ "expected backend implementation limit error, got:\n {stderr}"
119+ ) ;
120+ assert ! (
121+ !stderr. contains( "internal compiler error" ) ,
122+ "backend implementation limit should not ICE:\n {stderr}"
123+ ) ;
124+ assert ! (
125+ !stderr. contains( "expected abort due to worker thread errors" ) ,
126+ "worker thread fatal should be reported through diagnostics:\n {stderr}"
127+ ) ;
128+ } ) ,
95129 TestCase :: custom ( "test.sysroot" , & |runner| {
96130 apply_patches (
97131 & runner. dirs ,
0 commit comments