This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
tests/mir-opt/dataflow-const-prop Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1- // skip-filecheck
21// unit-test: DataflowConstProp
32
43// EMIT_MIR self_assign.main.DataflowConstProp.diff
4+
5+ // CHECK-LABEL: fn main
56fn main ( ) {
7+ // CHECK: debug a => [[a:_.*]];
8+ // CHECK: debug b => [[b:_.*]];
9+
610 let mut a = 0 ;
11+
12+ // CHECK: [[a]] = Add(move {{_[0-9]+}}, const 1_i32);
713 a = a + 1 ;
14+
15+ // CHECK: [[a]] = move {{_[0-9]+}};
816 a = a;
917
18+ // CHECK: [[b]] = &[[a]];
1019 let mut b = & a;
20+
21+ // CHECK: [[b]] = move {{_[0-9]+}};
1122 b = b;
23+
24+ // CHECK: [[a]] = move {{_[0-9]+}};
1225 a = * b;
1326}
Original file line number Diff line number Diff line change 1- // skip-filecheck
21// unit-test: DataflowConstProp
32
43// EMIT_MIR self_assign_add.main.DataflowConstProp.diff
4+
5+ // CHECK-LABEL: fn main
56fn main ( ) {
7+ // CHECK: debug a => [[a:_.*]];
68 let mut a = 0 ;
9+
10+ // CHECK: [[a]] = const 1_i32;
711 a += 1 ;
12+
13+ // CHECK: [[a]] = const 2_i32;
814 a += 1 ;
915}
Original file line number Diff line number Diff line change 1- // skip-filecheck
21// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32// This attempts to modify `x.1` via a pointer derived from `addr_of_mut!(x.0)`.
43// According to Miri, that is UB. However, T-opsem has not finalized that
109// unit-test: DataflowConstProp
1110
1211// EMIT_MIR sibling_ptr.main.DataflowConstProp.diff
12+
13+ // CHECK-LABEL: fn main
1314fn main ( ) {
15+ // CHECK: debug x1 => [[x1:_[0-9]+]];
16+
1417 let mut x: ( u8 , u8 ) = ( 0 , 0 ) ;
1518 unsafe {
1619 let p = std:: ptr:: addr_of_mut!( x. 0 ) ;
1720 * p. add ( 1 ) = 1 ;
1821 }
22+
23+ // CHECK: [[x1]] = ({{_[0-9]+}}.1: u8);
1924 let x1 = x. 1 ; // should not be propagated
2025}
You can’t perform that action at this time.
0 commit comments