Skip to content

Commit c5a6817

Browse files
committed
Add mir-opt test for references
1 parent cdf004d commit c5a6817

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ compile-flags: -C debug-assertions
2+
3+
struct Null {
4+
a: u32,
5+
}
6+
7+
fn main() {
8+
// CHECK-LABEL: fn main(
9+
// CHECK-NOT: {{assert.*}}
10+
let val: u32 = 42;
11+
let val_ref: &u32 = &val;
12+
let _access1: &u32 = &*val_ref;
13+
14+
let val = Null { a: 42 };
15+
let _access2: &u32 = &val.a;
16+
}

0 commit comments

Comments
 (0)