Skip to content

Commit

Permalink
Run filecheck on dest-prop/dead_stores_79191.rs and dead_stores_bette…
Browse files Browse the repository at this point in the history
…r.rs
  • Loading branch information
CastilloDel committed Apr 14, 2024
1 parent 853311c commit 0692090
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/mir-opt/dest-prop/dead_stores_79191.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ unit-test: DestinationPropagation

Expand All @@ -8,6 +7,13 @@ fn id<T>(x: T) -> T {

// EMIT_MIR dead_stores_79191.f.DestinationPropagation.after.mir
fn f(mut a: usize) -> usize {
// CHECK-LABEL: fn f(
// CHECK: debug a => [[a:_.*]];
// CHECK: debug b => [[b:_.*]];
// CHECK: [[b]] = [[a]];
// CHECK: [[a]] = const 5_usize;
// CHECK: [[a]] = move [[b]];
// CHECK: id::<usize>(move [[a]])
let b = a;
a = 5;
a = b;
Expand Down
8 changes: 7 additions & 1 deletion tests/mir-opt/dest-prop/dead_stores_better.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// 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.
Expand All @@ -12,6 +11,13 @@ fn id<T>(x: T) -> T {

// EMIT_MIR dead_stores_better.f.DestinationPropagation.after.mir
pub fn f(mut a: usize) -> usize {
// CHECK-LABEL: fn f(
// CHECK: debug a => [[a:_.*]];
// CHECK: debug b => [[b:_.*]];
// CHECK: [[b]] = [[a]];
// CHECK: [[a]] = const 5_usize;
// CHECK: [[a]] = move [[b]];
// CHECK: id::<usize>(move [[a]])
let b = a;
a = 5;
a = b;
Expand Down

0 comments on commit 0692090

Please sign in to comment.