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
2
1
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
3
2
// unit-test: DataflowConstProp
4
3
@@ -9,11 +8,21 @@ fn escape<T>(x: &T) {}
9
8
fn some_function ( ) { }
10
9
11
10
// EMIT_MIR ref_without_sb.main.DataflowConstProp.diff
11
+ // CHECK-LABEL: fn main
12
12
fn main ( ) {
13
+ // CHECK: debug a => [[a:_.*]];
14
+ // CHECK: debug b => [[b:_.*]];
15
+
13
16
let mut a = 0 ;
17
+
18
+ // CHECK: {{_[0-9]+}} = escape::<i32>(move {{_[0-9]+}}) -> [return: {{bb[0-9]+}}, unwind continue];
14
19
escape ( & a) ;
15
20
a = 1 ;
21
+
22
+ // CHECK: {{_[0-9]+}} = some_function() -> [return: {{bb[0-9]+}}, unwind continue];
16
23
some_function ( ) ;
17
24
// This should currently not be propagated.
25
+
26
+ // CHECK: [[b]] = [[a]];
18
27
let b = a;
19
28
}
Original file line number Diff line number Diff line change 1
- // skip-filecheck
2
1
// unit-test: DataflowConstProp
3
2
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
4
3
// EMIT_MIR_FOR_EACH_BIT_WIDTH
5
4
6
5
// EMIT_MIR repeat.main.DataflowConstProp.diff
6
+ // CHECK-LABEL: fn main
7
7
fn 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);
8
16
let x: u32 = [ 42 ; 8 ] [ 2 ] + 0 ;
9
17
}
Original file line number Diff line number Diff line change 1
- // skip-filecheck
2
1
// unit-test: DataflowConstProp
3
2
4
3
// The struct has scalar ABI, but is not a scalar type.
7
6
struct I32 ( i32 ) ;
8
7
9
8
// EMIT_MIR repr_transparent.main.DataflowConstProp.diff
9
+
10
+ // CHECK-LABEL: fn main
10
11
fn main ( ) {
12
+ // CHECK: debug x => [[x:_.*]];
13
+ // CHECK: debug y => [[y:_.*]];
14
+
15
+ // CHECK: [[x]] = const I32(0_i32);
11
16
let x = I32 ( 0 ) ;
17
+
18
+ // CHECK: [[y]] = const I32(0_i32);
12
19
let y = I32 ( x. 0 + x. 0 ) ;
13
20
}
You can’t perform that action at this time.
0 commit comments