summary refs log tree commit diff
path: root/src/test/ui/ptr_ops/issue-80309.rs
blob: bbec1012082c32b7531e1247771c4225777b7b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
// min-llvm-version: 13.0
// compiler-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) });
}