]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/dead-store-elimination/provenance_soundness.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / mir-opt / dead-store-elimination / provenance_soundness.rs
1 // unit-test: DeadStoreElimination
2 // compile-flags: -Zmir-emit-retag
3
4 // Test that we don't remove pointer to int casts or retags
5
6 // EMIT_MIR provenance_soundness.pointer_to_int.DeadStoreElimination.diff
7 fn pointer_to_int(p: *mut i32) {
8 let _x = p as usize;
9 let _y = p as isize;
10 }
11
12 // EMIT_MIR provenance_soundness.retags.DeadStoreElimination.diff
13 fn retags(_r: &mut i32) {}
14
15 fn main() {
16 pointer_to_int(&mut 5 as *mut _);
17 retags(&mut 5);
18 }