Fix counters for regions following `else if`s, fix
the counters for `else if` conditions, and fix
handling of `break` statements. Also while here,
clean up the handling of branch exit regions such
that we don't generate multiple overlapping
regions for each branch, but a single region at
the end of the entire `if` statement that accounts
for all exiting control flow.
rdar://104078910
rdar://104079242
When computing the counter for the region
following a labeled statement such as `if`, avoid
adding a new empty region if the counter for such
a region is known to be zero, i.e unreachable.
This avoids adding spurious unreachable regions
after an if statements where each branch returns,
throws, or otherwise jumps to a parent statement.
We will however still add the region if any code
follows such a statement, making it non-empty.
rdar://29390569
* Group tests for profiling instrumentation together, NFC
This will make it easier to test changes to the code coverage logic.
There are a handful of tests which relate to profiling which I have not
moved. These include tests for the driver and for the SIL optimizer. It
makes more sense to keep those tests where they are.
* Rename a test file, NFC
This file tests code coverage of primary files, so I've changed the name
of the file to reflect that.
* Simplify the check lines in a test, NFC
This file tests code coverage of closures. It had several check lines
which obscured the meaning of the test, and its check lines were in a
strange order.
Remove the extra checks and disable -emit-sorted-sil.