Skip to content

Commit

Permalink
Add test for -Zdump-mir-dataflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Dec 2, 2024
1 parent d37ed10 commit 9f2f690
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/mir-opt/dataflow.main.maybe_init.borrowck.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
digraph graph_for_def_id_0_3 {
graph[fontname="Courier, monospace"];
node[fontname="Courier, monospace"];
edge[fontname="Courier, monospace"];
bb_0[label=<<table border="1" cellborder="1" cellspacing="0" cellpadding="3" sides="rb"><tr><td colspan="3" sides="tl">bb0</td></tr><tr><td colspan="2" bgcolor="#a0a0a0" sides="tl">MIR</td><td bgcolor="#a0a0a0" sides="tl">STATE</td></tr><tr><td valign="bottom" sides="tl" align="right"></td><td valign="bottom" sides="tl" align="left">(on start)</td><td colspan="1" valign="bottom" sides="tl" align="left">{}</td></tr><tr><td valign="top" sides="tl" bgcolor="#f0f0f0" align="right">0</td><td valign="top" sides="tl" bgcolor="#f0f0f0" align="left">_0 = const ()</td><td valign="top" sides="tl" bgcolor="#f0f0f0" align="left"><font color="darkgreen">+_0</font></td></tr><tr><td valign="top" sides="tl" align="right">T</td><td valign="top" sides="tl" align="left">return</td><td valign="top" sides="tl" align="left"></td></tr><tr><td valign="bottom" sides="tl" bgcolor="#f0f0f0" align="right"></td><td valign="bottom" sides="tl" bgcolor="#f0f0f0" align="left">(on end)</td><td colspan="1" valign="bottom" sides="tl" bgcolor="#f0f0f0" align="left">{_0}</td></tr></table>>][shape="none"];
}
6 changes: 6 additions & 0 deletions tests/mir-opt/dataflow.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// skip-filecheck
// Test graphviz dataflow output
//@ compile-flags: -Z dump-mir=main -Z dump-mir-dataflow

// EMIT_MIR dataflow.main.maybe_init.borrowck.dot
fn main() {}

0 comments on commit 9f2f690

Please sign in to comment.