File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
3
+
4
+ // This unusual use of 'sh' allows the path of the profraw file to be
5
+ // substituted by %target-run.
6
+ // RUN: %target-codesign %t/main
7
+ // RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
8
+
9
+ // RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
+ // RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s
11
+
12
+ // REQUIRES: profile_runtime
13
+ // REQUIRES: executable_test
14
+ // REQUIRES: objc_interop
15
+ // REQUIRES: OS=macosx
16
+
17
+ // https://github.com/apple/swift/issues/42929
18
+
19
+ // There are actually only 14 lines here, but llvm-cov doesn't handle closures
20
+ // properly (rdar://90348983).
21
+ // CHECK: "lines":{"count":18,"covered":18{{.*}}"functions":{"count":7,"covered":7
22
+
23
+ import Foundation
24
+
25
+ func foo( _ x: @autoclosure ( ) -> Bool ) { _ = x ( ) }
26
+
27
+ func bar( ) {
28
+ foo ( . random( ) )
29
+ foo ( . random( ) )
30
+
31
+ class C : NSObject {
32
+ class D : NSObject {
33
+ }
34
+ }
35
+
36
+ foo ( . random( ) )
37
+ foo ( . random( ) )
38
+ }
39
+ bar ( )
You can’t perform that action at this time.
0 commit comments