Skip to content

Commit da4a40f

Browse files
committed
Remove copy of current const prop tests and add a few new tests
1 parent 1f82a9f commit da4a40f

File tree

106 files changed

+253
-2500
lines changed

Some content is hidden

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

106 files changed

+253
-2500
lines changed

src/test/mir-opt/dataflow-const-prop/checked.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// unit-test: DataflowConstProp
2-
// compile-flags: -C overflow-checks=on
2+
// compile-flags: -Zunsound-mir-opts -Coverflow-checks=on
33

44
// EMIT_MIR checked.main.DataflowConstProp.diff
55
#[allow(arithmetic_overflow)]
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
+ // MIR for `main` after DataflowConstProp
33

44
fn main() -> () {
5-
let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow_checks_use.rs:+0:11: +0:11
6-
let mut _1: u8; // in scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
7-
let mut _2: u8; // in scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
8-
let mut _3: u8; // in scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
5+
let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
6+
let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
7+
let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
8+
let mut _3: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
99
scope 1 {
1010
}
11-
scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow_checks_use.rs:7:13: 7:47
11+
scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:7:13: 7:47
1212
debug self => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
1313
debug other => _3; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
1414
let mut _4: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
@@ -17,11 +17,11 @@
1717
}
1818

1919
bb0: {
20-
StorageLive(_1); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
21-
StorageLive(_2); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
22-
_2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
23-
StorageLive(_3); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
24-
_3 = const 1_u8; // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
20+
StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
21+
StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
22+
_2 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
23+
StorageLive(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
24+
_3 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
2525
StorageLive(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
2626
_4 = const u8::MAX; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
2727
StorageLive(_5); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
@@ -35,11 +35,11 @@
3535
+ _1 = const 0_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
3636
StorageDead(_5); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
3737
StorageDead(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
38-
StorageDead(_3); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
39-
StorageDead(_2); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:13: +3:47
40-
StorageDead(_1); // scope 0 at $DIR/inherit_overflow_checks_use.rs:+3:47: +3:48
41-
nop; // scope 0 at $DIR/inherit_overflow_checks_use.rs:+0:11: +4:2
42-
return; // scope 0 at $DIR/inherit_overflow_checks_use.rs:+4:2: +4:2
38+
StorageDead(_3); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
39+
StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
40+
StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:47: +3:48
41+
nop; // scope 0 at $DIR/inherit_overflow.rs:+0:11: +4:2
42+
return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
4343
}
4444
}
4545

src/test/mir-opt/dataflow-const-prop/inherit_overflow_checks_use.rs renamed to src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// compile-flags: -C overflow-checks=off
1+
// compile-flags: -Coverflow-checks=off -Zunsound-mir-opts
22

3-
// EMIT_MIR inherit_overflow_checks_use.main.DataflowConstProp.diff
3+
// EMIT_MIR inherit_overflow.main.DataflowConstProp.diff
44
fn main() {
55
// After inlining, this will contain a `CheckedBinaryOp`. The overflow
66
// must be ignored by the constant propagation to avoid triggering a panic.

src/test/mir-opt/dataflow-const-prop/issue_81605.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// unit-test: DataflowConstProp
2+
// compile-flags: -Zunsound-mir-opts
23

34
// EMIT_MIR issue_81605.f.DataflowConstProp.diff
45
fn f() -> usize {

src/test/mir-opt/dataflow-const-prop/previous/aggregate.main.DataflowConstProp.diff

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/test/mir-opt/dataflow-const-prop/previous/aggregate.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/mir-opt/dataflow-const-prop/previous/array_index.main.DataflowConstProp.32bit.diff

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/test/mir-opt/dataflow-const-prop/previous/array_index.main.DataflowConstProp.64bit.diff

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/test/mir-opt/dataflow-const-prop/previous/array_index.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/mir-opt/dataflow-const-prop/previous/bad_op_div_by_zero.main.DataflowConstProp.diff

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)