mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
14 lines
235 B
Rust
14 lines
235 B
Rust
//@ run-pass
|
|
//@ compile-flags: -O
|
|
|
|
// 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) });
|
|
}
|