Skip to content

Commit 43e36cc

Browse files
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 check SILGen's output by extracting just the `string_literal` lines and then sorting them. 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 d5005f8 commit 43e36cc

File tree

1 file changed

+426
-289
lines changed

1 file changed

+426
-289
lines changed

0 commit comments

Comments
 (0)