2022-02-04 08:11:51 -06:00
|
|
|
// run-pass
|
2022-02-21 19:53:16 -06:00
|
|
|
// compile-flags: -O
|
2022-02-04 08:11:51 -06:00
|
|
|
|
|
|
|
// Regression test for issue #80309
|
|
|
|
|
|
|
|
pub unsafe fn foo(x: *const i8) -> i8 {
|
|
|
|
*x.wrapping_sub(x as _).wrapping_add(x as _)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 42;
|
|
|
|
println!("{}", unsafe { foo(&x) });
|
|
|
|
}
|