summary refs log tree commit diff
path: root/tests/codegen/issues/issue-106369.rs
blob: fd375e4e605845bad443b50e8cbd5ada68a03f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ compile-flags: -O

#![crate_type = "lib"]

// From <https://github.com/rust-lang/rust/issues/106369#issuecomment-1369095304>

// CHECK-LABEL: @issue_106369(
#[no_mangle]
pub unsafe fn issue_106369(ptr: *const &i32) -> bool {
    // CHECK-NOT: icmp
    // CHECK: ret i1 true
    // CHECK-NOT: icmp
    Some(std::ptr::read(ptr)).is_some()
}