diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-21 14:34:12 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-22 14:28:48 +0200 |
| commit | a27f3e3fd1e4d16160f8885b6b06665b5319f56c (patch) | |
| tree | b033935392cbadf6f85d2dbddf433a88e323aeeb /tests/codegen/issues/issue-37945.rs | |
| parent | ed93c1783b404d728d4809973a0550eb33cd293f (diff) | |
| download | rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.tar.gz rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.zip | |
Rename `tests/codegen` into `tests/codegen-llvm`
Diffstat (limited to 'tests/codegen/issues/issue-37945.rs')
| -rw-r--r-- | tests/codegen/issues/issue-37945.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen/issues/issue-37945.rs deleted file mode 100644 index 23d0eab8ae4..00000000000 --- a/tests/codegen/issues/issue-37945.rs +++ /dev/null @@ -1,34 +0,0 @@ -//@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled -//@ ignore-32bit LLVM has a bug with them - -// Check that LLVM understands that `Iter` pointer is not null. Issue #37945. - -#![crate_type = "lib"] - -use std::slice::Iter; - -#[no_mangle] -pub fn is_empty_1(xs: Iter<f32>) -> bool { - // CHECK-LABEL: @is_empty_1( - // CHECK-NEXT: start: - // CHECK-NEXT: [[A:%.*]] = icmp ne ptr {{%xs.0|%xs.1}}, null - // CHECK-NEXT: tail call void @llvm.assume(i1 [[A]]) - // The order between %xs.0 and %xs.1 on the next line doesn't matter - // and different LLVM versions produce different order. - // CHECK-NEXT: [[B:%.*]] = icmp eq ptr {{%xs.0, %xs.1|%xs.1, %xs.0}} - // CHECK-NEXT: ret i1 [[B:%.*]] - { xs }.next().is_none() -} - -#[no_mangle] -pub fn is_empty_2(xs: Iter<f32>) -> bool { - // CHECK-LABEL: @is_empty_2 - // CHECK-NEXT: start: - // CHECK-NEXT: [[C:%.*]] = icmp ne ptr {{%xs.0|%xs.1}}, null - // CHECK-NEXT: tail call void @llvm.assume(i1 [[C]]) - // The order between %xs.0 and %xs.1 on the next line doesn't matter - // and different LLVM versions produce different order. - // CHECK-NEXT: [[D:%.*]] = icmp eq ptr {{%xs.0, %xs.1|%xs.1, %xs.0}} - // CHECK-NEXT: ret i1 [[D:%.*]] - xs.map(|&x| x).next().is_none() -} |
