Skip to content

Commit c36a09c

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 c36a09c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/codegen/intrinsics/select_unpredictable.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ pub fn test_struct(p: bool, a: Large, b: Large) -> Large {
3434
#[no_mangle]
3535
pub fn test_zst(p: bool, a: (), b: ()) -> () {
3636
// CHECK-LABEL: define{{.*}} @test_zst
37+
// CHECK-NOT: select
38+
// CHECK: ret void
3739
core::intrinsics::select_unpredictable(p, a, b)
3840
}
3941

@@ -63,5 +65,7 @@ pub fn test_struct2(p: bool, a: Large, b: Large) -> Large {
6365
#[no_mangle]
6466
pub fn test_zst2(p: bool, a: (), b: ()) -> () {
6567
// CHECK-LABEL: define{{.*}} @test_zst2
68+
// CHECK-NOT: select
69+
// CHECK: ret void
6670
p.select_unpredictable(a, b)
6771
}

0 commit comments

Comments
 (0)