Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/mir-opt/copy-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,14 @@ fn id<T>(x: T) -> T {

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