Commit Graph

15 Commits

Author SHA1 Message Date
Hamish Knight
3325296401 [test] Enable some profiler tests on non-macOS 2024-08-04 10:45:29 +01:00
Hamish Knight
49ad980b86 [Profiler] Map regions for error-throwing AST nodes
Map a counter for the error branch of a given
potentially-throwing expression, and subtract it
from the following region count.

rdar://34244637
2023-11-16 17:28:57 +00:00
Vedant Kumar
9066d9132e Revert "[test] Fix a bug in test/Profiler/coverage_smoke.swift" (#38894)
This reverts commit ebdb4d9ace, due to
https://reviews.llvm.org/D85036 being reverted upstream.

rdar://81815347
2021-08-16 11:49:02 -07:00
Vedant Kumar
92c159ced8 Revert "[test] Fix a bug in test/Profiler/coverage_smoke.swift" (#38893)
This reverts commit 956558f23f, due to
https://reviews.llvm.org/D85036 being reverted upstream.

rdar://81815347
2021-08-16 11:46:12 -07:00
Vedant Kumar
cfd38c42a1 [Profiler] Assign counter to IfStmt condition
Push a region to cover any expressions within an IfStmt condition.

rdar://67280997
2020-08-18 14:05:24 -07:00
Vedant Kumar
0ade2ffa6e [test] Weaken a test in coverage_smoke.swift
The test regressed after D85036. rdar://67280997 tracks a proper fix for
this issue.
2020-08-17 17:02:04 -07:00
Vedant Kumar
ebdb4d9ace [test] Fix a bug in test/Profiler/coverage_smoke.swift
A 'catch' line was marked with the wrong execution count. This was
exposed by D85036.
2020-08-14 14:34:59 -07:00
swift_jenkins
8dd7cac75d Merge remote-tracking branch 'origin/master' into master-next 2020-08-07 19:46:31 -07:00
Mishal Shah
a3cd8bc9e9 [Tests] Codesign the binary before executing the test 2020-08-07 00:26:07 -07:00
Vedant Kumar
956558f23f [test] Fix a bug in test/Profiler/coverage_smoke.swift
The two sides of an if-expr can't have counts that add up to more than
the count of the if-expr.

This was exposed by https://reviews.llvm.org/D85036.

rdar://66642166
2020-08-06 15:42:36 -07:00
Vedant Kumar
569c8afc54 [Profiler] Separate profiler instances for property inits and constructors (#25247)
Assign separate SILProfiler instances to stored property initializers
and constructors.

Starting with rdar://39460313, coverage reporting for these constructs
was bundled up into a single SILProfiler uniqued by the NominalTypeDecl.
There are two problems with doing this.

First, the shared SILProfiler is given a fake name that can't be
demangled. That breaks Xcode's reports.  Second, the relationship
between SILProfiler and SILFunction is supposed to be 1:1. Having a
shared SILProfiler muddies things a bit and requires extra bookkeeping.

rdar://47467864
2019-06-05 10:38:10 -07:00
Vedant Kumar
a9da803033 [SILProfiler] Set up profiling for lazily-emitted functions (#22403)
A SIL function that's initially only emitted as a declaration may later
be prepared for definition. When this happens, set up a profiler for the
definition.

This makes code coverage visible for private methods (the frontend
follows a declare-then-define pattern for these).

rdar://47759243
2019-02-05 19:57:18 -08:00
Jordan Rose
01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Vedant Kumar
d3ea09fafc [Coverage] Fix mappings of regions following do-catch stmts
Coverage reporting for source regions following do-catch statements was
incorrect, because it did not properly reflect early exits.

rdar://34244637
2018-05-18 12:11:14 -07:00
Vedant Kumar
c3f4d99e57 Group the the code coverage, profiling, and pgo tests together (#16070)
* 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.
2018-04-20 15:15:52 -07:00