Skip to content

Commit 5f527eb

Browse files
committed
add codegen test for rust-lang#68667
1 parent bf17818 commit 5f527eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![crate_type = "lib"]
2+
3+
//@ compile-flags: -O
4+
5+
// MIR inlining now optimizes this code.
6+
7+
// CHECK-LABEL: @unwrap_combinators
8+
// CHECK: icmp
9+
// CHECK-NEXT: icmp
10+
// CHECK-NEXT: select i1
11+
// CHECK-NEXT: ret i1
12+
#[no_mangle]
13+
pub fn unwrap_combinators(a: Option<i32>, b: i32) -> bool {
14+
a.map(|t| t >= b)
15+
.unwrap_or(false)
16+
}
17+

0 commit comments

Comments
 (0)