mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
* 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.
18 lines
577 B
Swift
18 lines
577 B
Swift
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_if %s | %FileCheck %s
|
|
|
|
// CHECK-LABEL: sil_coverage_map {{.*}}// coverage_if.foo
|
|
func foo(x : Bool) { // CHECK: [[@LINE]]:20 -> {{[0-9]+}}:2 : 0
|
|
if (x) { // CHECK: [[@LINE]]:10 -> [[@LINE+1]]:4 : 1
|
|
}
|
|
|
|
if (!x) { // CHECK: [[@LINE]]:11 -> [[@LINE+2]]:4 : 2
|
|
// ...
|
|
}
|
|
|
|
if (x) { } // CHECK: [[@LINE]]:10 -> [[@LINE]]:13 : 3
|
|
else { } // CHECK: [[@LINE]]:10 -> [[@LINE]]:13 : (0 - 3)
|
|
}
|
|
|
|
foo(x: true);
|
|
foo(x: false);
|