]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/issue-74739.rs
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / ui / mir / issue-74739.rs
1 // compile-flags: -O
2 // run-pass
3
4 struct Foo {
5     x: i32,
6 }
7
8 pub fn main() {
9     let mut foo = Foo { x: 42 };
10     let x = &mut foo.x;
11     *x = 13;
12     let y = foo;
13     assert_eq!(y.x, 13); // used to print 42 due to mir-opt bug
14 }