From afccc444022f17fea184c65758827f9d5e64922b Mon Sep 17 00:00:00 2001 From: Eric Mark Martin Date: Wed, 5 Jul 2023 02:19:44 +0000 Subject: [PATCH] add mir dump test --- tests/mir-opt/building/issue_110508.rs | 13 +++++++++++++ .../issue_110508.{impl#0}-BAR1.built.after.mir | 14 ++++++++++++++ .../issue_110508.{impl#0}-BAR2.built.after.mir | 14 ++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 tests/mir-opt/building/issue_110508.rs create mode 100644 tests/mir-opt/building/issue_110508.{impl#0}-BAR1.built.after.mir create mode 100644 tests/mir-opt/building/issue_110508.{impl#0}-BAR2.built.after.mir diff --git a/tests/mir-opt/building/issue_110508.rs b/tests/mir-opt/building/issue_110508.rs new file mode 100644 index 00000000000..120b026a70f --- /dev/null +++ b/tests/mir-opt/building/issue_110508.rs @@ -0,0 +1,13 @@ +// EMIT_MIR issue_110508.{impl#0}-BAR1.built.after.mir +// EMIT_MIR issue_110508.{impl#0}-BAR2.built.after.mir + +enum Foo { + Bar(()), +} + +impl Foo { + const BAR1: Foo = Foo::Bar(()); + const BAR2: Foo = Self::Bar(()); +} + +fn main() {} diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-BAR1.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-BAR1.built.after.mir new file mode 100644 index 00000000000..6adcdcae762 --- /dev/null +++ b/tests/mir-opt/building/issue_110508.{impl#0}-BAR1.built.after.mir @@ -0,0 +1,14 @@ +// MIR for `::BAR1` after built + +const ::BAR1: Foo = { + let mut _0: Foo; + let mut _1: (); + + bb0: { + StorageLive(_1); + _1 = (); + _0 = Foo::Bar(move _1); + StorageDead(_1); + return; + } +} diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-BAR2.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-BAR2.built.after.mir new file mode 100644 index 00000000000..d1bd45fba26 --- /dev/null +++ b/tests/mir-opt/building/issue_110508.{impl#0}-BAR2.built.after.mir @@ -0,0 +1,14 @@ +// MIR for `::BAR2` after built + +const ::BAR2: Foo = { + let mut _0: Foo; + let mut _1: (); + + bb0: { + StorageLive(_1); + _1 = (); + _0 = Foo::Bar(move _1); + StorageDead(_1); + return; + } +}