2024-05-20 16:33:53 -05:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
//@ compile-flags: -O
|
|
|
|
|
|
|
|
// MIR inlining now optimizes this code.
|
|
|
|
|
|
|
|
// CHECK-LABEL: @unwrap_combinators
|
2024-07-30 04:06:26 -05:00
|
|
|
// CHECK: {{icmp|trunc}}
|
2024-05-20 16:33:53 -05:00
|
|
|
// CHECK-NEXT: icmp
|
|
|
|
// CHECK-NEXT: select i1
|
|
|
|
// CHECK-NEXT: ret i1
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn unwrap_combinators(a: Option<i32>, b: i32) -> bool {
|
2024-06-09 08:25:12 -05:00
|
|
|
a.map(|t| t >= b).unwrap_or(false)
|
2024-05-20 16:33:53 -05:00
|
|
|
}
|