Skip to content

Commit d432379

Browse files
committed
Add a test
1 parent e41bd6c commit d432379

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//@ test-mir-pass: ReferencePropagation
2+
3+
#![feature(custom_mir, core_intrinsics)]
4+
#![allow(internal_features)]
5+
#![crate_type = "lib"]
6+
7+
use std::intrinsics::mir::*;
8+
9+
#[inline(never)]
10+
fn opaque(_: impl Sized, _: impl Sized) {}
11+
12+
#[custom_mir(dialect = "runtime")]
13+
pub fn fn0() {
14+
// CHECK-LABEL: fn0
15+
// CHECK: _9 = opaque::<&u8, &u64>(copy (_2.1: &u8), copy _6) -> [return: bb1, unwind unreachable];
16+
mir! {
17+
let _1: (u8, u8);
18+
let _2: (u64, &u8);
19+
let _3: (u8, &&u64);
20+
let _4: u64;
21+
let _5: &u64;
22+
let _6: &u64;
23+
let _7: &u64;
24+
let _8: u64;
25+
let n: ();
26+
{
27+
_3.0 = 0;
28+
_1 = (0, _3.0);
29+
_4 = 0;
30+
_2.1 = &_1.0;
31+
_8 = 0;
32+
_5 = &_8;
33+
_5 = &_4;
34+
_6 = _5;
35+
_7 = _6;
36+
_3.1 = &_6;
37+
Call(n = opaque(_2.1, Move(_6)), ReturnTo(bb1), UnwindUnreachable())
38+
}
39+
bb1 = {
40+
_2.0 = *_7;
41+
Return()
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)