Add a codegen test to confirm this fixes 106369
This commit is contained in:
parent
b2c717fa33
commit
0b96fee343
15
tests/codegen/issues/issue-106369.rs
Normal file
15
tests/codegen/issues/issue-106369.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// compile-flags: -O
|
||||
// ignore-debug (the extra assertions get in the way)
|
||||
|
||||
#![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()
|
||||
}
|
Loading…
Reference in New Issue
Block a user