2 // compile-flags: -C no-prepopulate-passes
4 // Test that tuples get optimized layout, in particular with a ZST in the last field (#63244)
8 type ScalarZstLast = (u128, ());
9 // CHECK: define i128 @test_ScalarZstLast(i128 %_1)
11 pub fn test_ScalarZstLast(_: ScalarZstLast) -> ScalarZstLast { loop {} }
13 type ScalarZstFirst = ((), u128);
14 // CHECK: define i128 @test_ScalarZstFirst(i128 %_1)
16 pub fn test_ScalarZstFirst(_: ScalarZstFirst) -> ScalarZstFirst { loop {} }
18 type ScalarPairZstLast = (u8, u128, ());
19 // CHECK: define { i128, i8 } @test_ScalarPairZstLast(i128 %_1.0, i8 %_1.1)
21 pub fn test_ScalarPairZstLast(_: ScalarPairZstLast) -> ScalarPairZstLast { loop {} }
23 type ScalarPairZstFirst = ((), u8, u128);
24 // CHECK: define { i8, i128 } @test_ScalarPairZstFirst(i8 %_1.0, i128 %_1.1)
26 pub fn test_ScalarPairZstFirst(_: ScalarPairZstFirst) -> ScalarPairZstFirst { loop {} }
28 type ScalarPairLotsOfZsts = ((), u8, (), u128, ());
29 // CHECK: define { i128, i8 } @test_ScalarPairLotsOfZsts(i128 %_1.0, i8 %_1.1)
31 pub fn test_ScalarPairLotsOfZsts(_: ScalarPairLotsOfZsts) -> ScalarPairLotsOfZsts { loop {} }
33 type ScalarPairLottaNesting = (((), ((), u8, (), u128, ())), ());
34 // CHECK: define { i128, i8 } @test_ScalarPairLottaNesting(i128 %_1.0, i8 %_1.1)
36 pub fn test_ScalarPairLottaNesting(_: ScalarPairLottaNesting) -> ScalarPairLottaNesting { loop {} }