]> git.lizzy.rs Git - rust.git/blob - src/test/ui/ptr_ops/issue-80309.rs
Auto merge of #95841 - ChrisDenton:pipe-server, r=m-ou-se
[rust.git] / src / test / ui / ptr_ops / issue-80309.rs
1 // run-pass
2 // min-llvm-version: 13.0
3 // compile-flags: -O
4
5 // Regression test for issue #80309
6
7 pub unsafe fn foo(x: *const i8) -> i8 {
8     *x.wrapping_sub(x as _).wrapping_add(x as _)
9 }
10
11 fn main() {
12     let x = 42;
13     println!("{}", unsafe { foo(&x) });
14 }