tests: mark option-niche-eq as fixed on LLVM 21

Some combination of recent Rust changes (between 3d86494a0d and
aa57e46e24 from what I can tell) and changes in LLVM 21 (not recently,
as best I can tell) have caused this test to start showing the behavior
we want, so it's time to move this test to a proper place and mark it as
fixed on LLVM 21.
This commit is contained in:
Augie Fackler 2025-05-27 10:52:09 -04:00
parent 0fc6f1672b
commit a963e6fc38
2 changed files with 11 additions and 15 deletions

View file

@ -1,5 +1,7 @@
//@ revisions: REGULAR LLVM21
//@ min-llvm-version: 20
//@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled
//@ [LLVM21] min-llvm-version: 21
#![crate_type = "lib"]
extern crate core;
@ -74,3 +76,12 @@ pub fn niche_eq(l: Option<EnumWithNiche>, r: Option<EnumWithNiche>) -> bool {
// CHECK-NEXT: ret i1
l == r
}
// LLVM21-LABEL: @bool_eq
#[no_mangle]
pub fn bool_eq(l: Option<bool>, r: Option<bool>) -> bool {
// LLVM21: start:
// LLVM21-NEXT: icmp eq i8
// LLVM21-NEXT: ret i1
l == r
}

View file

@ -1,15 +0,0 @@
//@ should-fail
//@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled
//! FIXME(#49892)
//! Tests that LLVM does not fully optimize comparisons of `Option<bool>`.
//! If this starts passing, it can be moved to `tests/codegen/option-niche-eq.rs`
#![crate_type = "lib"]
// CHECK-LABEL: @bool_eq
#[no_mangle]
pub fn bool_eq(l: Option<bool>, r: Option<bool>) -> bool {
// CHECK: start:
// CHECK-NEXT: icmp eq i8
// CHECK-NEXT: ret i1
l == r
}