diff options
| author | Trevor Gross <tmgross@umich.edu> | 2025-01-05 08:44:01 +0000 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2025-01-05 08:51:15 +0000 |
| commit | 74d2d4bfa475a131df0c9ee0754b022a458cd152 (patch) | |
| tree | 2e6dd15894e2f193814cb26786e350534ed0b924 /tests/codegen/intrinsics/select_unpredictable.rs | |
| parent | d42c3ae02f4c54fe3bdac7e0cc49c3c51e8fb517 (diff) | |
| download | rust-74d2d4bfa475a131df0c9ee0754b022a458cd152.tar.gz rust-74d2d4bfa475a131df0c9ee0754b022a458cd152.zip | |
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.
Diffstat (limited to 'tests/codegen/intrinsics/select_unpredictable.rs')
| -rw-r--r-- | tests/codegen/intrinsics/select_unpredictable.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/codegen/intrinsics/select_unpredictable.rs b/tests/codegen/intrinsics/select_unpredictable.rs index b03c9708b8e..ea6127a48bf 100644 --- a/tests/codegen/intrinsics/select_unpredictable.rs +++ b/tests/codegen/intrinsics/select_unpredictable.rs @@ -31,9 +31,12 @@ pub fn test_struct(p: bool, a: Large, b: Large) -> Large { core::intrinsics::select_unpredictable(p, a, b) } +// ZSTs should not need a `select` expression. #[no_mangle] pub fn test_zst(p: bool, a: (), b: ()) -> () { // CHECK-LABEL: define{{.*}} @test_zst + // CHECK-NEXT: start: + // CHECK-NEXT: ret void core::intrinsics::select_unpredictable(p, a, b) } @@ -63,5 +66,7 @@ pub fn test_struct2(p: bool, a: Large, b: Large) -> Large { #[no_mangle] pub fn test_zst2(p: bool, a: (), b: ()) -> () { // CHECK-LABEL: define{{.*}} @test_zst2 + // CHECK-NEXT: start: + // CHECK-NEXT: ret void p.select_unpredictable(a, b) } |
