Skip to content

Commit 0b96fee

Browse files
committed
Add a codegen test to confirm this fixes 106369
1 parent b2c717f commit 0b96fee

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/codegen/issues/issue-106369.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-flags: -O
2+
// ignore-debug (the extra assertions get in the way)
3+
4+
#![crate_type = "lib"]
5+
6+
// From <https://github.com/rust-lang/rust/issues/106369#issuecomment-1369095304>
7+
8+
// CHECK-LABEL: @issue_106369(
9+
#[no_mangle]
10+
pub unsafe fn issue_106369(ptr: *const &i32) -> bool {
11+
// CHECK-NOT: icmp
12+
// CHECK: ret i1 true
13+
// CHECK-NOT: icmp
14+
Some(std::ptr::read(ptr)).is_some()
15+
}

0 commit comments

Comments
 (0)