Commit 62d1fe4
committed
Tests: Re-design skip-function-bodies.swift test.
The skip-function-bodies.swift test previously relied on `-emit-sorted-sil` to
control the order of SIL emission for matching CHECK: lines. I found that this
made the test too difficult to evolve, so I've re-written the test to instead
use SILGen's natural output order. This makes it much more straightforward to
add new test cases at the right location in the file.
There are a number of additional improvements to the test:
- SILGen without any function body skipping is now checked as a baseline to
ensure that all the checks are in the right order. Previously, most of the
negative CHECK lines were not properly ordered in the file, so they could have
missed regressions.
- Every declaration in the test has a set of exhaustive CHECK lines covering
each of the outputs explicitly. While more verbose, it should be clearer what
is expected for every declaration.
- Module interfaces are emitted with the proper flags and are typechecked to
verify they are valid.
- Superfluous diagnostics (e.g. unused variables) have been minimized to
improve the experience of debugging failures.1 parent 82ef296 commit 62d1fe4
1 file changed
+417
-289
lines changed
0 commit comments