about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2019-03-24 15:32:48 +0800
committerkennytm <kennytm@gmail.com>2019-03-24 18:59:42 +0800
commit42b7d2c170bfe1623e63ff913bf2d2ac4d059bc1 (patch)
tree433fe23d5bb6bc07b13ee5dd43ead725d4aa7748 /src/test
parent48dc8efc8595d397b3820a0784f0dbe553c3fb27 (diff)
parent64303189f0b3a111c3b1e59d77cdaad91ca90efe (diff)
downloadrust-42b7d2c170bfe1623e63ff913bf2d2ac4d059bc1.tar.gz
rust-42b7d2c170bfe1623e63ff913bf2d2ac4d059bc1.zip
Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkov
Use a valid name for graphviz graphs

Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/graphviz.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/mir-opt/graphviz.rs b/src/test/mir-opt/graphviz.rs
new file mode 100644
index 00000000000..660576996e5
--- /dev/null
+++ b/src/test/mir-opt/graphviz.rs
@@ -0,0 +1,23 @@
+// Test graphviz output
+// compile-flags: -Z dump-mir-graphviz
+
+// ignore-tidy-linelength
+
+fn main() {}
+
+// END RUST SOURCE
+// START rustc.main.mir_map.0.dot
+// digraph Mir_0_0_3 { // The name here MUST be an ASCII identifier.
+//     graph [fontname="monospace"];
+//     node [fontname="monospace"];
+//     edge [fontname="monospace"];
+//     label=<fn main() -&gt; ()<br align="left"/>>;
+//     bb0 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">0</td></tr><tr><td align="left" balign="left">_0 = ()<br/></td></tr><tr><td align="left">goto</td></tr></table>
+// >];
+//     bb1 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">1</td></tr><tr><td align="left">resume</td></tr></table>
+// >];
+//     bb2 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">2</td></tr><tr><td align="left">return</td></tr></table>
+// >];
+//     bb0 -> bb2 [label=""];
+// }
+// END rustc.main.mir_map.0.dot