diff options
Diffstat (limited to 'tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs')
-rw-r--r-- | tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs new file mode 100644 index 000000000..de6585741 --- /dev/null +++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs @@ -0,0 +1,14 @@ +// unit-test: SimplifyLocals-before-const-prop + +fn map(x: Option<Box<()>>) -> Option<Box<()>> { + match x { + None => None, + Some(x) => Some(x), + } +} + +fn main() { + map(None); +} + +// EMIT_MIR simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff |