summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dest-prop
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/mir-opt/dest-prop
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/dest-prop')
-rw-r--r--tests/mir-opt/dest-prop/branch.rs1
-rw-r--r--tests/mir-opt/dest-prop/copy_propagation_arg.rs1
-rw-r--r--tests/mir-opt/dest-prop/cycle.rs1
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_79191.rs1
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir7
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir7
-rw-r--r--tests/mir-opt/dest-prop/dead_stores_better.rs1
-rw-r--r--tests/mir-opt/dest-prop/simple.rs1
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff17
-rw-r--r--tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff17
-rw-r--r--tests/mir-opt/dest-prop/union.rs1
-rw-r--r--tests/mir-opt/dest-prop/unreachable.rs1
12 files changed, 26 insertions, 30 deletions
diff --git a/tests/mir-opt/dest-prop/branch.rs b/tests/mir-opt/dest-prop/branch.rs
index 5007aafb6..d8c74a0aa 100644
--- a/tests/mir-opt/dest-prop/branch.rs
+++ b/tests/mir-opt/dest-prop/branch.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that assignment in both branches of an `if` are eliminated.
// unit-test: DestinationPropagation
diff --git a/tests/mir-opt/dest-prop/copy_propagation_arg.rs b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
index 1f8d58892..435cf07ab 100644
--- a/tests/mir-opt/dest-prop/copy_propagation_arg.rs
+++ b/tests/mir-opt/dest-prop/copy_propagation_arg.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that DestinationPropagation does not propagate an assignment to a function argument
// (doing so can break usages of the original argument value)
diff --git a/tests/mir-opt/dest-prop/cycle.rs b/tests/mir-opt/dest-prop/cycle.rs
index 9bc0cb05a..77cff062c 100644
--- a/tests/mir-opt/dest-prop/cycle.rs
+++ b/tests/mir-opt/dest-prop/cycle.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
// unit-test: DestinationPropagation
diff --git a/tests/mir-opt/dest-prop/dead_stores_79191.rs b/tests/mir-opt/dest-prop/dead_stores_79191.rs
index 2f95ba0e3..a6fd542d3 100644
--- a/tests/mir-opt/dest-prop/dead_stores_79191.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_79191.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DestinationPropagation
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir
index a3ec09010..eb160fc19 100644
--- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir
+++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-abort.mir
@@ -7,15 +7,16 @@ fn f(_1: usize) -> usize {
let mut _3: usize;
let mut _4: usize;
scope 1 {
- debug b => _1;
+ debug b => _3;
}
bb0: {
nop;
+ _3 = _1;
+ _1 = const 5_usize;
nop;
nop;
- nop;
- nop;
+ _1 = move _3;
nop;
nop;
nop;
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir
index 185feb4b4..9147de2ec 100644
--- a/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir
+++ b/tests/mir-opt/dest-prop/dead_stores_better.f.DestinationPropagation.after.panic-unwind.mir
@@ -7,15 +7,16 @@ fn f(_1: usize) -> usize {
let mut _3: usize;
let mut _4: usize;
scope 1 {
- debug b => _1;
+ debug b => _3;
}
bb0: {
nop;
+ _3 = _1;
+ _1 = const 5_usize;
nop;
nop;
- nop;
- nop;
+ _1 = move _3;
nop;
nop;
nop;
diff --git a/tests/mir-opt/dest-prop/dead_stores_better.rs b/tests/mir-opt/dest-prop/dead_stores_better.rs
index e67653c57..c9895f35c 100644
--- a/tests/mir-opt/dest-prop/dead_stores_better.rs
+++ b/tests/mir-opt/dest-prop/dead_stores_better.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This is a copy of the `dead_stores_79191` test, except that we turn on DSE. This demonstrates
// that that pass enables this one to do more optimizations.
diff --git a/tests/mir-opt/dest-prop/simple.rs b/tests/mir-opt/dest-prop/simple.rs
index 0bcb2924f..03d209626 100644
--- a/tests/mir-opt/dest-prop/simple.rs
+++ b/tests/mir-opt/dest-prop/simple.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Copy of `nrvo-simple.rs`, to ensure that full dest-prop handles it too.
// unit-test: DestinationPropagation
diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff
index 459a9c442..142e08f4d 100644
--- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff
+++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-abort.diff
@@ -4,27 +4,20 @@
fn main() -> () {
let mut _0: ();
let _1: main::Un;
- let mut _2: u32;
- let mut _3: u32;
scope 1 {
debug un => _1;
scope 2 {
}
- scope 3 (inlined std::mem::drop::<u32>) {
- debug _x => _3;
+ scope 4 (inlined std::mem::drop::<u32>) {
+ debug _x => const 1_u32;
}
}
+ scope 3 (inlined val) {
+ }
bb0: {
StorageLive(_1);
- StorageLive(_2);
- _2 = val() -> [return: bb1, unwind unreachable];
- }
-
- bb1: {
- StorageDead(_2);
- StorageLive(_3);
- StorageDead(_3);
+ _1 = Un { us: const 1_u32 };
StorageDead(_1);
return;
}
diff --git a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff
index d2eef9058..142e08f4d 100644
--- a/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff
+++ b/tests/mir-opt/dest-prop/union.main.DestinationPropagation.panic-unwind.diff
@@ -4,27 +4,20 @@
fn main() -> () {
let mut _0: ();
let _1: main::Un;
- let mut _2: u32;
- let mut _3: u32;
scope 1 {
debug un => _1;
scope 2 {
}
- scope 3 (inlined std::mem::drop::<u32>) {
- debug _x => _3;
+ scope 4 (inlined std::mem::drop::<u32>) {
+ debug _x => const 1_u32;
}
}
+ scope 3 (inlined val) {
+ }
bb0: {
StorageLive(_1);
- StorageLive(_2);
- _2 = val() -> [return: bb1, unwind continue];
- }
-
- bb1: {
- StorageDead(_2);
- StorageLive(_3);
- StorageDead(_3);
+ _1 = Un { us: const 1_u32 };
StorageDead(_1);
return;
}
diff --git a/tests/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs
index 4bc6f28c6..6d3e6d7fa 100644
--- a/tests/mir-opt/dest-prop/union.rs
+++ b/tests/mir-opt/dest-prop/union.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we can propagate into places that are projections into unions
// compile-flags: -Zunsound-mir-opts
diff --git a/tests/mir-opt/dest-prop/unreachable.rs b/tests/mir-opt/dest-prop/unreachable.rs
index e950dbbf5..a47d2a0c8 100644
--- a/tests/mir-opt/dest-prop/unreachable.rs
+++ b/tests/mir-opt/dest-prop/unreachable.rs
@@ -1,3 +1,4 @@
+// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// Check that unreachable code is removed after the destination propagation.
// Regression test for issue #105428.