Skip to content

Commit 74d2d4b

Browse files
committed
Expand the select_unpredictable test for ZSTs
For ZSTs there is no selection that needs to take place, so assert that no `select` statement is emitted.
1 parent d42c3ae commit 74d2d4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/codegen/intrinsics/select_unpredictable.rs

+5
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ pub fn test_struct(p: bool, a: Large, b: Large) -> Large {
3131
core::intrinsics::select_unpredictable(p, a, b)
3232
}
3333

34+
// ZSTs should not need a `select` expression.
3435
#[no_mangle]
3536
pub fn test_zst(p: bool, a: (), b: ()) -> () {
3637
// CHECK-LABEL: define{{.*}} @test_zst
38+
// CHECK-NEXT: start:
39+
// CHECK-NEXT: ret void
3740
core::intrinsics::select_unpredictable(p, a, b)
3841
}
3942

@@ -63,5 +66,7 @@ pub fn test_struct2(p: bool, a: Large, b: Large) -> Large {
6366
#[no_mangle]
6467
pub fn test_zst2(p: bool, a: (), b: ()) -> () {
6568
// CHECK-LABEL: define{{.*}} @test_zst2
69+
// CHECK-NEXT: start:
70+
// CHECK-NEXT: ret void
6671
p.select_unpredictable(a, b)
6772
}

0 commit comments

Comments
 (0)