Add print-cfg tests

This commit is contained in:
Morgan Phillips
2016-07-14 13:43:11 -07:00
parent 0cdcf29308
commit 5bcce51bd9
6 changed files with 118 additions and 1 deletions

14
tests/cfg/README.rst Normal file
View File

@@ -0,0 +1,14 @@
CFG tests
============
This directory contains test cases for the Cretonne cfg printer.
Each test case consists of a `foo.cton` input file annotated with its expected connections.
Annotations are comments of the form: `ebbx:insty -> ebbz` where ebbx is connected to ebbz via
a branch or jump instruction at line y. Instructions are labeled by line number starting from zero: `inst0` .. `instn`.
Each input file is run through the `cton-util print-cfg` command and the
output is compared against the specially formatted comments to ensure that
expected connections exist. This scheme allows for changes to graph style
without the need to update tests.