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// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32// unit-test: DataflowConstProp
43
@@ -9,11 +8,21 @@ fn escape<T>(x: &T) {}
98fn some_function ( ) { }
109
1110// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
11+ // CHECK-LABEL: fn main
1212fn main ( ) {
13+ // CHECK: debug a => [[a:_.*]];
14+ // CHECK: debug b => [[b:_.*]];
15+
1316 let mut a = 0 ;
17+
18+ // CHECK: {{_[0-9]+}} = escape::<i32>(move {{_[0-9]+}}) -> [return: {{bb[0-9]+}}, unwind continue];
1419 escape ( & a) ;
1520 a = 1 ;
21+
22+ // CHECK: {{_[0-9]+}} = some_function() -> [return: {{bb[0-9]+}}, unwind continue];
1623 some_function ( ) ;
1724 // This should currently not be propagated.
25+
26+ // CHECK: [[b]] = [[a]];
1827 let b = a;
1928}
Original file line number Diff line number Diff line change 1- // skip-filecheck
21// unit-test: DataflowConstProp
32// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
43// EMIT_MIR_FOR_EACH_BIT_WIDTH
54
65// EMIT_MIR repeat.main.DataflowConstProp.diff
6+ // CHECK-LABEL: fn main
77fn main ( ) {
8+ // CHECK: debug x => [[x:_.*]];
9+
10+ // CHECK: {{_[0-9]+}} = const 8_usize;
11+ // CHECK: {{_[0-9]+}} = const true;
12+ // CHECK-LABEL: assert(const true
13+
14+ // CHECK: {{_[0-9]+}} = {{_[0-9]+}}[2 of 3];
15+ // CHECK: [[x]] = Add(move {{_[0-9]+}}, const 0_u32);
816 let x: u32 = [ 42 ; 8 ] [ 2 ] + 0 ;
917}
Original file line number Diff line number Diff line change 1- // skip-filecheck
21// unit-test: DataflowConstProp
32
43// The struct has scalar ABI, but is not a scalar type.
76struct I32 ( i32 ) ;
87
98// EMIT_MIR repr_transparent.main.DataflowConstProp.diff
9+
10+ // CHECK-LABEL: fn main
1011fn main ( ) {
12+ // CHECK: debug x => [[x:_.*]];
13+ // CHECK: debug y => [[y:_.*]];
14+
15+ // CHECK: [[x]] = const I32(0_i32);
1116 let x = I32 ( 0 ) ;
17+
18+ // CHECK: [[y]] = const I32(0_i32);
1219 let y = I32 ( x. 0 + x. 0 ) ;
1320}
You can’t perform that action at this time.
0 commit comments