1 This folder contains tests for MIR optimizations.
8 // START $file_name_of_some_mir_dump_0
12 // END $file_name_of_some_mir_dump_0
14 // START $file_name_of_some_mir_dump_N
18 // END $file_name_of_some_mir_dump_N
21 All the test information is in comments so the test is runnable.
23 For each $file_name, compiletest expects [$expected_line_0, ...,
24 $expected_line_N] to appear in the dumped MIR in order. Currently it allows
25 other non-matched lines before, after and in-between. Note that this includes
26 lines that end basic blocks or begin new ones; it is good practice
27 in your tests to include the terminator for each of your basic blocks as an
28 internal sanity check guarding against a test like:
38 that will inadvertantly pattern-matching against:
52 Lines match ignoring whitespace, and the prefix "//" is removed.
54 It also currently strips trailing comments -- partly because the full file path
55 in "scope comments" is unpredictable and partly because tidy complains about
56 the lines being too long.
58 compiletest handles dumping the MIR before and after every pass for you. The
59 test writer only has to specify the file names of the dumped files (not the
60 full path to the file) and what lines to expect. There is an option to rustc
61 that tells it to dump the mir into some directly (rather then always dumping to
62 the current directory).