mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-01 13:34:38 +00:00
16 lines
462 B
Rust
16 lines
462 B
Rust
//@ 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
|
|
}
|