Skip to content

Commit ee30cc8

Browse files
committed
make some const prop tests unit-test
1 parent 36f4f4a commit ee30cc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+60
-38
lines changed

src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
+ _1 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
2525
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
2626
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
27-
nop; // scope 0 at $DIR/aggregate.rs:+0:11: +2:2
27+
_0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +2:2
2828
StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+2:1: +2:2
2929
return; // scope 0 at $DIR/aggregate.rs:+2:2: +2:2
3030
}

src/test/mir-opt/const_prop/aggregate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -O
23

34
// EMIT_MIR aggregate.main.ConstProp.diff

src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
1919
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
2020
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
21-
_4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
21+
- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2222
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2323
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
24+
+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2425
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
25-
+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
26+
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2627
}
2728

2829
bb1: {
2930
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
3031
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
3132
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
3233
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
33-
nop; // scope 0 at $DIR/array_index.rs:+0:11: +2:2
34+
_0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
3435
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
3536
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
3637
}

src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
1919
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
2020
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
21-
_4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
21+
- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2222
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2323
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
24+
+ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2425
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
25-
+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
26+
+ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
2627
}
2728

2829
bb1: {
2930
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
3031
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
3132
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
3233
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
33-
nop; // scope 0 at $DIR/array_index.rs:+0:11: +2:2
34+
_0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
3435
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
3536
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
3637
}

src/test/mir-opt/const_prop/array_index.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// EMIT_MIR_FOR_EACH_BIT_WIDTH
23

34
// EMIT_MIR array_index.main.ConstProp.diff

src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff

+4-6
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
2525
- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
2626
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
27-
- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
2827
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
2928
+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
30-
+ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
29+
assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
3130
}
3231

3332
bb1: {
@@ -38,14 +37,13 @@
3837
+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
3938
+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
4039
+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
41-
+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
40+
+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
4241
}
4342

4443
bb2: {
45-
- _2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
46-
+ _2 = Div(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
44+
_2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
4745
StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
48-
nop; // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
46+
_0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
4947
StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
5048
StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
5149
return; // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:2: +3:2

src/test/mir-opt/const_prop/bad_op_div_by_zero.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// EMIT_MIR bad_op_div_by_zero.main.ConstProp.diff
23
#[allow(unconditional_panic)]
34
fn main() {

src/test/mir-opt/const_prop/boolean_identities.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -O -Zmir-opt-level=4
23

34
// EMIT_MIR boolean_identities.test.ConstProp.diff

src/test/mir-opt/const_prop/boxes.main.ConstProp.diff

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
StorageLive(_3); // scope 0 at $DIR/boxes.rs:+1:14: +1:22
2727
- _4 = SizeOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +1:22
2828
- _5 = AlignOf(i32); // scope 2 at $DIR/boxes.rs:+1:14: +1:22
29-
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
3029
+ _4 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
3130
+ _5 = const 4_usize; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
32-
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> bb1; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
31+
_6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // scope 2 at $DIR/boxes.rs:+1:14: +1:22
3332
// mir::Constant
34-
// + span: $DIR/boxes.rs:12:14: 12:22
33+
// + span: $DIR/boxes.rs:13:14: 13:22
3534
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
3635
}
3736

@@ -55,7 +54,7 @@
5554

5655
bb2: {
5756
StorageDead(_3); // scope 0 at $DIR/boxes.rs:+1:26: +1:27
58-
nop; // scope 0 at $DIR/boxes.rs:+0:11: +2:2
57+
_0 = const (); // scope 0 at $DIR/boxes.rs:+0:11: +2:2
5958
StorageDead(_1); // scope 0 at $DIR/boxes.rs:+2:1: +2:2
6059
return; // scope 0 at $DIR/boxes.rs:+2:2: +2:2
6160
}

src/test/mir-opt/const_prop/boxes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -O
23
// ignore-emscripten compiled with panic=abort by default
34
// ignore-wasm32

src/test/mir-opt/const_prop/cast.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
StorageLive(_2); // scope 1 at $DIR/cast.rs:+3:9: +3:10
2020
- _2 = const 42_u32 as u8 (Misc); // scope 1 at $DIR/cast.rs:+3:13: +3:24
2121
+ _2 = const 42_u8; // scope 1 at $DIR/cast.rs:+3:13: +3:24
22-
nop; // scope 0 at $DIR/cast.rs:+0:11: +4:2
22+
_0 = const (); // scope 0 at $DIR/cast.rs:+0:11: +4:2
2323
StorageDead(_2); // scope 1 at $DIR/cast.rs:+4:1: +4:2
2424
StorageDead(_1); // scope 0 at $DIR/cast.rs:+4:1: +4:2
2525
return; // scope 0 at $DIR/cast.rs:+4:2: +4:2

src/test/mir-opt/const_prop/cast.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// EMIT_MIR cast.main.ConstProp.diff
23

34
fn main() {

src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
bb1: {
2121
- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
2222
+ _1 = const 2_u32; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
23-
nop; // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
23+
_0 = const (); // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
2424
StorageDead(_1); // scope 0 at $DIR/checked_add.rs:+2:1: +2:2
2525
return; // scope 0 at $DIR/checked_add.rs:+2:2: +2:2
2626
}

src/test/mir-opt/const_prop/checked_add.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -C overflow-checks=on
23

34
// EMIT_MIR checked_add.main.ConstProp.diff

src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
1919
_3 = const FOO; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
2020
// mir::Constant
21-
// + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
21+
// + span: $DIR/const_prop_fails_gracefully.rs:8:13: 8:16
2222
// + literal: Const { ty: &i32, val: Unevaluated(FOO, [], None) }
2323
_2 = &raw const (*_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
2424
_1 = move _2 as usize (PointerExposeAddress); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:39
@@ -29,14 +29,14 @@
2929
_5 = _1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:10: +3:11
3030
_4 = read(move _5) -> bb1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:5: +3:12
3131
// mir::Constant
32-
// + span: $DIR/const_prop_fails_gracefully.rs:8:5: 8:9
32+
// + span: $DIR/const_prop_fails_gracefully.rs:9:5: 9:9
3333
// + literal: Const { ty: fn(usize) {read}, val: Value(<ZST>) }
3434
}
3535

3636
bb1: {
3737
StorageDead(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:11: +3:12
3838
StorageDead(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:12: +3:13
39-
nop; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
39+
_0 = const (); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
4040
StorageDead(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:1: +4:2
4141
return; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:2: +4:2
4242
}

src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
#[inline(never)]
23
fn read(_: usize) { }
34

src/test/mir-opt/const_prop/control-flow-simplification.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
// unit-test: ConstProp
12
// compile-flags: -Zmir-opt-level=1
23

3-
trait NeedsDrop:Sized{
4-
const NEEDS:bool=std::mem::needs_drop::<Self>();
4+
trait NeedsDrop: Sized {
5+
const NEEDS: bool = std::mem::needs_drop::<Self>();
56
}
67

7-
impl<This> NeedsDrop for This{}
8+
impl<This> NeedsDrop for This {}
89

910
// EMIT_MIR control_flow_simplification.hello.ConstProp.diff
1011
// EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir

src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
4545
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
4646
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
47-
nop; // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
47+
_0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
4848
StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
4949
return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
5050
}

src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
4545
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
4646
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
47-
nop; // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
47+
_0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
4848
StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
4949
return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
5050
}

src/test/mir-opt/const_prop/discriminant.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -O
23

34
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with

src/test/mir-opt/const_prop/indirect.main.ConstProp.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
1919
+ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:25
2020
+ _3 = const (3_u8, false); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
21-
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u8, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
21+
+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
2222
}
2323

2424
bb1: {
2525
- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
2626
+ _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
2727
StorageDead(_2); // scope 0 at $DIR/indirect.rs:+1:28: +1:29
28-
nop; // scope 0 at $DIR/indirect.rs:+0:11: +2:2
28+
_0 = const (); // scope 0 at $DIR/indirect.rs:+0:11: +2:2
2929
StorageDead(_1); // scope 0 at $DIR/indirect.rs:+2:1: +2:2
3030
return; // scope 0 at $DIR/indirect.rs:+2:2: +2:2
3131
}

src/test/mir-opt/const_prop/indirect.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -C overflow-checks=on
23

34
// EMIT_MIR indirect.main.ConstProp.diff

src/test/mir-opt/const_prop/issue-66971.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -Z mir-opt-level=3
23

34
// Due to a bug in propagating scalar pairs the assertion below used to fail. In the expected

src/test/mir-opt/const_prop/issue-67019.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// compile-flags: -Z mir-opt-level=3
23

34
// This used to ICE in const-prop

src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
StorageDead(_3); // scope 0 at $DIR/issue-66971.rs:+1:21: +1:22
2020
_1 = encode(move _2) -> bb1; // scope 0 at $DIR/issue-66971.rs:+1:5: +1:23
2121
// mir::Constant
22-
// + span: $DIR/issue-66971.rs:16:5: 16:11
22+
// + span: $DIR/issue-66971.rs:17:5: 17:11
2323
// + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(<ZST>) }
2424
}
2525

src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
StorageDead(_3); // scope 0 at $DIR/issue-67019.rs:+1:18: +1:19
2121
_1 = test(move _2) -> bb1; // scope 0 at $DIR/issue-67019.rs:+1:5: +1:20
2222
// mir::Constant
23-
// + span: $DIR/issue-67019.rs:11:5: 11:9
23+
// + span: $DIR/issue-67019.rs:12:5: 12:9
2424
// + literal: Const { ty: fn(((u8, u8),)) {test}, val: Value(<ZST>) }
2525
}
2626

src/test/mir-opt/const_prop/mult_by_zero.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O -Zmir-opt-level=4
23

34
// EMIT_MIR mult_by_zero.test.ConstProp.diff

src/test/mir-opt/const_prop/mutable_variable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O
23

34
// EMIT_MIR mutable_variable.main.ConstProp.diff

src/test/mir-opt/const_prop/mutable_variable_aggregate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O
23

34
// EMIT_MIR mutable_variable_aggregate.main.ConstProp.diff

src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O
23

34
// EMIT_MIR mutable_variable_aggregate_mut_ref.main.ConstProp.diff

src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:9: +1:14
1717
_1 = foo() -> bb1; // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:+1:29: +1:34
1818
// mir::Constant
19-
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:5:29: 5:32
19+
// + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:29: 6:32
2020
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
2121
}
2222

src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O
23

34
// EMIT_MIR mutable_variable_aggregate_partial_read.main.ConstProp.diff

src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
2626
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
2727
// mir::Constant
28-
// + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
28+
// + span: $DIR/mutable_variable_no_prop.rs:10:13: 10:19
2929
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
3030
_3 = (*_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
3131
_1 = move _3; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19

src/test/mir-opt/const_prop/mutable_variable_no_prop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test
12
// compile-flags: -O
23

34
static mut STATIC: u32 = 42;

0 commit comments

Comments
 (0)