summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dataflow-const-prop
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/mir-opt/dataflow-const-prop
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/cast.rs (renamed from src/test/mir-opt/dataflow-const-prop/cast.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/checked.rs (renamed from src/test/mir-opt/dataflow-const-prop/checked.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff)2
-rw-r--r--tests/mir-opt/dataflow-const-prop/enum.rs (renamed from src/test/mir-opt/dataflow-const-prop/enum.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff)8
-rw-r--r--tests/mir-opt/dataflow-const-prop/if.rs (renamed from src/test/mir-opt/dataflow-const-prop/if.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff39
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.rs (renamed from src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff)4
-rw-r--r--tests/mir-opt/dataflow-const-prop/issue_81605.rs (renamed from src/test/mir-opt/dataflow-const-prop/issue_81605.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/ref_without_sb.rs (renamed from src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/repr_transparent.rs (renamed from src/test/mir-opt/dataflow-const-prop/repr_transparent.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign.rs (renamed from src/test/mir-opt/dataflow-const-prop/self_assign.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/self_assign_add.rs (renamed from src/test/mir-opt/dataflow-const-prop/self_assign_add.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/sibling_ptr.rs (renamed from src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/struct.rs (renamed from src/test/mir-opt/dataflow-const-prop/struct.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/terminator.rs (renamed from src/test/mir-opt/dataflow-const-prop/terminator.rs)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff (renamed from src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff)0
-rw-r--r--tests/mir-opt/dataflow-const-prop/tuple.rs (renamed from src/test/mir-opt/dataflow-const-prop/tuple.rs)0
28 files changed, 46 insertions, 7 deletions
diff --git a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
index bf9ab8669..bf9ab8669 100644
--- a/src/test/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/cast.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/cast.rs b/tests/mir-opt/dataflow-const-prop/cast.rs
index 484403f7f..484403f7f 100644
--- a/src/test/mir-opt/dataflow-const-prop/cast.rs
+++ b/tests/mir-opt/dataflow-const-prop/cast.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
index a4ebd0c8c..a4ebd0c8c 100644
--- a/src/test/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs
index 0738a4ee5..0738a4ee5 100644
--- a/src/test/mir-opt/dataflow-const-prop/checked.rs
+++ b/tests/mir-opt/dataflow-const-prop/checked.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff
index 2ced794e6..fce18fae4 100644
--- a/src/test/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff
@@ -28,7 +28,7 @@
discriminant(_1) = 0; // scope 0 at $DIR/enum.rs:+1:13: +1:21
StorageLive(_2); // scope 1 at $DIR/enum.rs:+2:9: +2:10
_3 = discriminant(_1); // scope 1 at $DIR/enum.rs:+2:19: +2:20
- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
+ switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
}
bb1: {
diff --git a/src/test/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs
index 13288577d..13288577d 100644
--- a/src/test/mir-opt/dataflow-const-prop/enum.rs
+++ b/tests/mir-opt/dataflow-const-prop/enum.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
index 26808c70f..32489b4bd 100644
--- a/src/test/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/if.main.DataflowConstProp.diff
@@ -42,8 +42,8 @@
+ _4 = const 1_i32; // scope 1 at $DIR/if.rs:+2:16: +2:17
+ _3 = const true; // scope 1 at $DIR/if.rs:+2:16: +2:22
StorageDead(_4); // scope 1 at $DIR/if.rs:+2:21: +2:22
-- switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
-+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
+- switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/if.rs:+2:16: +2:22
}
bb1: {
@@ -73,8 +73,8 @@
+ _9 = const 1_i32; // scope 3 at $DIR/if.rs:+5:16: +5:17
+ _8 = const true; // scope 3 at $DIR/if.rs:+5:16: +5:22
StorageDead(_9); // scope 3 at $DIR/if.rs:+5:21: +5:22
-- switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
-+ switchInt(const true) -> [false: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
+- switchInt(move _8) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
++ switchInt(const true) -> [0: bb5, otherwise: bb4]; // scope 3 at $DIR/if.rs:+5:16: +5:22
}
bb4: {
diff --git a/src/test/mir-opt/dataflow-const-prop/if.rs b/tests/mir-opt/dataflow-const-prop/if.rs
index 34fc35790..34fc35790 100644
--- a/src/test/mir-opt/dataflow-const-prop/if.rs
+++ b/tests/mir-opt/dataflow-const-prop/if.rs
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
new file mode 100644
index 000000000..02aafd7ac
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
@@ -0,0 +1,39 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/inherit_overflow.rs:+0:11: +0:11
+ let mut _1: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ let mut _2: u8; // in scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ scope 1 {
+ }
+ scope 2 (inlined <u8 as Add>::add) { // at $DIR/inherit_overflow.rs:7:13: 7:47
+ debug self => _1; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ debug other => _2; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ let mut _3: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ let mut _4: u8; // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ let mut _5: (u8, bool); // in scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ _1 = const u8::MAX; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ StorageLive(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ _2 = const 1_u8; // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ StorageLive(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ _3 = const u8::MAX; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ StorageLive(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ _4 = const 1_u8; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ _5 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ }
+
+ bb1: {
+ StorageDead(_4); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ StorageDead(_3); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ StorageDead(_2); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ StorageDead(_1); // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+ return; // scope 0 at $DIR/inherit_overflow.rs:+4:2: +4:2
+ }
+ }
+
diff --git a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
index 2f2d9d010..2f2d9d010 100644
--- a/src/test/mir-opt/dataflow-const-prop/inherit_overflow.rs
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
index 881d80f7c..5a8788497 100644
--- a/src/test/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/issue_81605.f.DataflowConstProp.diff
@@ -10,8 +10,8 @@
StorageLive(_1); // scope 0 at $DIR/issue_81605.rs:+1:9: +1:33
StorageLive(_2); // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
_2 = const true; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
-+ switchInt(const true) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
+- switchInt(move _2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
++ switchInt(const true) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/issue_81605.rs:+1:12: +1:16
}
bb1: {
diff --git a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs b/tests/mir-opt/dataflow-const-prop/issue_81605.rs
index d75e2a28b..d75e2a28b 100644
--- a/src/test/mir-opt/dataflow-const-prop/issue_81605.rs
+++ b/tests/mir-opt/dataflow-const-prop/issue_81605.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff
index 158f187f1..158f187f1 100644
--- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
index 2fd480b09..2fd480b09 100644
--- a/src/test/mir-opt/dataflow-const-prop/ref_without_sb.rs
+++ b/tests/mir-opt/dataflow-const-prop/ref_without_sb.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
index f66b00a9a..f66b00a9a 100644
--- a/src/test/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/repr_transparent.rs b/tests/mir-opt/dataflow-const-prop/repr_transparent.rs
index 4ce0ca4df..4ce0ca4df 100644
--- a/src/test/mir-opt/dataflow-const-prop/repr_transparent.rs
+++ b/tests/mir-opt/dataflow-const-prop/repr_transparent.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
index df08eff94..df08eff94 100644
--- a/src/test/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/self_assign.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign.rs b/tests/mir-opt/dataflow-const-prop/self_assign.rs
index 8de2195f9..8de2195f9 100644
--- a/src/test/mir-opt/dataflow-const-prop/self_assign.rs
+++ b/tests/mir-opt/dataflow-const-prop/self_assign.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
index c09e4061e..c09e4061e 100644
--- a/src/test/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs b/tests/mir-opt/dataflow-const-prop/self_assign_add.rs
index e32827624..e32827624 100644
--- a/src/test/mir-opt/dataflow-const-prop/self_assign_add.rs
+++ b/tests/mir-opt/dataflow-const-prop/self_assign_add.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
index 8126d4b85..8126d4b85 100644
--- a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
index 87ef00d18..87ef00d18 100644
--- a/src/test/mir-opt/dataflow-const-prop/sibling_ptr.rs
+++ b/tests/mir-opt/dataflow-const-prop/sibling_ptr.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
index cfb2706c1..cfb2706c1 100644
--- a/src/test/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/struct.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs
index 841b279e0..841b279e0 100644
--- a/src/test/mir-opt/dataflow-const-prop/struct.rs
+++ b/tests/mir-opt/dataflow-const-prop/struct.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
index 8018400e7..8018400e7 100644
--- a/src/test/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/terminator.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/terminator.rs b/tests/mir-opt/dataflow-const-prop/terminator.rs
index d151f666a..d151f666a 100644
--- a/src/test/mir-opt/dataflow-const-prop/terminator.rs
+++ b/tests/mir-opt/dataflow-const-prop/terminator.rs
diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
index e028def00..e028def00 100644
--- a/src/test/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/tuple.main.DataflowConstProp.diff
diff --git a/src/test/mir-opt/dataflow-const-prop/tuple.rs b/tests/mir-opt/dataflow-const-prop/tuple.rs
index 92c70eab0..92c70eab0 100644
--- a/src/test/mir-opt/dataflow-const-prop/tuple.rs
+++ b/tests/mir-opt/dataflow-const-prop/tuple.rs