Skip to content

Commit a36e0de

Browse files
committed
Add a test
1 parent e41bd6c commit a36e0de

File tree

1 file changed

+45
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)