File tree Expand file tree Collapse file tree 19 files changed +20
-74
lines changed Expand file tree Collapse file tree 19 files changed +20
-74
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck %s
11
9
12
10
// REQUIRES: profile_runtime
13
11
// REQUIRES: executable_test
14
- // REQUIRES: OS=macosx
15
12
16
13
struct Err : Error { }
17
14
Original file line number Diff line number Diff line change 2
2
3
3
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -O -o %t/main
4
4
5
- // This unusual use of 'sh' allows the path of the profraw file to be
6
- // substituted by %target-run.
7
5
// RUN: %target-codesign %t/main
8
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
6
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
9
7
10
8
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
11
9
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s
12
10
13
11
// REQUIRES: profile_runtime
14
12
// REQUIRES: executable_test
15
- // REQUIRES: OS=macosx
16
13
17
14
// CHECK: "lines":{"count":9,"covered":5{{.*}}"functions":{"count":5,"covered":3
18
15
Original file line number Diff line number Diff line change 2
2
3
3
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
4
4
5
- // This unusual use of 'sh' allows the path of the profraw file to be
6
- // substituted by %target-run.
7
5
// RUN: %target-codesign %t/main
8
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
6
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
9
7
10
8
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
11
9
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck --check-prefix SUMMARY %s
12
10
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck --implicit-check-not "{{[ ]*\|[ ]*[0-9]+}}" %s
13
11
14
12
// REQUIRES: profile_runtime
15
13
// REQUIRES: executable_test
16
- // REQUIRES: OS=macosx
17
14
18
15
// The line count here excludes the inactive regions.
19
16
// SUMMARY: "lines":{"count":41,"covered":0
Original file line number Diff line number Diff line change 1
1
// REQUIRES: profile_runtime
2
2
// REQUIRES: executable_test
3
- // REQUIRES: OS=macosx
4
3
5
4
// This test is to make sure llvm-cov can deal with a coverage-prefix-map.
6
5
14
13
15
14
// RUN: %target-build-swift -profile-generate -profile-coverage-mapping -Xfrontend -coverage-prefix-map -Xfrontend %t/root=. -Xfrontend -disable-incremental-llvm-codegen -o %t/main %t/root/nested/coverage_relative_path.swift
16
15
17
- // This unusual use of 'sh' allows the path of the profraw file to be
18
- // substituted by %target-run.
19
16
// RUN: %target-codesign %t/main
20
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
17
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
21
18
22
19
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
23
20
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck --check-prefix SHOW %s
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -Xfrontend -disable-incremental-llvm-codegen -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %llvm-profdata show %t/default.profdata -function=f_internal | %FileCheck %s --check-prefix=CHECK-INTERNAL
16
14
17
15
// REQUIRES: profile_runtime
18
16
// REQUIRES: executable_test
19
- // REQUIRES: OS=macosx
20
17
21
18
// CHECK-INTERNAL: Functions shown: 1
22
19
// CHECK-COV: {{ *}}[[@LINE+1]]|{{ *}}1{{.*}}func f_internal
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend %s -profile-generate -profile-coverage-mapping -sanitize=address -emit-ir -o - | %FileCheck %s
2
2
// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s
3
3
4
- // REQUIRES: OS=macosx
5
-
6
4
// CHECK: main
7
5
func main( ) { }
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s
Original file line number Diff line number Diff line change 2
2
// RUN: %empty-directory(%t)
3
3
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_checked_cast -o %t/main
4
4
5
- // This unusual use of 'sh' allows the path of the profraw file to be
6
- // substituted by %target-run.
7
5
// RUN: %target-codesign %t/main
8
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
6
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
9
7
10
8
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
11
9
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_checked_cast -o - | %FileCheck %s --check-prefix=SIL
17
15
18
16
// REQUIRES: profile_runtime
19
17
// REQUIRES: executable_test
20
- // REQUIRES: OS=macosx
21
18
22
19
// SIL-LABEL: // pgo_checked_cast.check1<A>(Any, A) -> A
23
20
// SIL-LABEL: sil @$s16pgo_checked_cast6check1yxyp_xtlF : $@convention(thin) <T> (@in_guaranteed Any, @in_guaranteed T) -> @out T !function_entry_count(5001) {
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_foreach -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// need to move counts attached to expr for this
18
16
19
17
// REQUIRES: profile_runtime
20
18
// REQUIRES: executable_test
21
- // REQUIRES: OS=macosx
22
19
23
20
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
24
21
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_guard -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_guard -o - | %FileCheck %s --check-prefix=SIL
9
+ // RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-ir -module-name pgo_guard -o - | cat
11
10
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-ir -module-name pgo_guard -o - | %FileCheck %s --check-prefix=IR
12
11
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -O -emit-sorted-sil -emit-sil -module-name pgo_guard -o - | %FileCheck %s --check-prefix=SIL-OPT
13
12
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -O -emit-ir -module-name pgo_guard -o - | %FileCheck %s --check-prefix=IR-OPT
14
13
15
14
// REQUIRES: profile_runtime
16
15
// REQUIRES: executable_test
17
- // REQUIRES: OS=macosx
18
16
19
17
// SIL-LABEL: // pgo_guard.guess1
20
18
// SIL-LABEL: sil @$s9pgo_guard6guess11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5002) {
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_if -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_if -o - | %FileCheck %s --check-prefix=SIL
13
11
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -O -emit-ir -module-name pgo_if -o - | %FileCheck %s --check-prefix=IR-OPT
14
12
15
13
// REQUIRES: profile_runtime
16
- // REQUIRES: OS=macosx
17
14
// REQUIRES: executable_test
18
15
19
16
// SIL-LABEL: // pgo_if.guess1
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_lazy -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
15
13
16
14
// REQUIRES: profile_runtime
17
15
// REQUIRES: executable_test
18
- // REQUIRES: OS=macosx
19
16
20
17
var cond = true
21
18
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_repeatwhile -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_repeatwhile -o - | %FileCheck %s --check-prefix=SIL
15
13
16
14
// REQUIRES: profile_runtime
17
15
// REQUIRES: executable_test
18
- // REQUIRES: OS=macosx
19
16
20
17
// SIL-LABEL: // pgo_repeatwhile.guessWhile
21
18
// SIL-LABEL: sil @$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(42) {
Original file line number Diff line number Diff line change 2
2
// RUN: %empty-directory(%t)
3
3
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_switchenum -o %t/main
4
4
5
- // This unusual use of 'sh' allows the path of the profraw file to be
6
- // substituted by %target-run.
7
5
// RUN: %target-codesign %t/main
8
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
6
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
9
7
10
8
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
11
9
// need to move counts attached to expr for this
19
17
20
18
// REQUIRES: profile_runtime
21
19
// REQUIRES: executable_test
22
- // REQUIRES: OS=macosx
23
20
24
21
public enum MaybePair {
25
22
case Neither
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_while -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -Xllvm -sil-full-demangle -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_while -o - | %FileCheck %s --check-prefix=SIL
15
13
16
14
// REQUIRES: profile_runtime
17
15
// REQUIRES: executable_test
18
- // REQUIRES: OS=macosx
19
16
20
17
// SIL-LABEL: // pgo_while.guessWhile
21
18
// SIL-LABEL: sil @$s9pgo_while10guessWhile1xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(42) {
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_with_coverage -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
13
11
14
12
// REQUIRES: profile_runtime
15
13
// REQUIRES: executable_test
16
- // REQUIRES: OS=macosx
17
14
18
15
// Make sure we don't try and profile implicit decls during PGO.
19
16
// IR-NOT: no profile data available
Original file line number Diff line number Diff line change 10
10
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -O -Xfrontend -disable-sil-perf-optzns -Xfrontend -disable-new-llvm-pass-manager -o %t/main1
11
11
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -O -Xfrontend -disable-sil-perf-optzns -Xfrontend -enable-new-llvm-pass-manager -o %t/main2
12
12
13
- // This unusual use of 'sh' allows the path of the profraw file to be
14
- // substituted by %target-run.
15
13
// RUN: %target-codesign %t/main1
16
14
// RUN: %target-codesign %t/main2
17
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default1.profraw %t/main1
18
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default2.profraw %t/main2
15
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default1.profraw %target-run %t/main1
16
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default2.profraw %target-run %t/main2
19
17
20
18
// RUN: %llvm-profdata merge %t/default1.profraw -o %t/default1.profdata
21
19
// RUN: %llvm-profdata merge %t/default2.profraw -o %t/default2.profdata
25
23
26
24
// REQUIRES: profile_runtime
27
25
// REQUIRES: executable_test
28
- // REQUIRES: OS=macosx
29
26
30
27
sil_stage canonical
31
28
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_si_inlinelarge -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_si_inlinelarge -o - | %FileCheck %s --check-prefix=SIL
11
9
// RUN: %target-swift-frontend %s -profile-use=%t/default.profdata -O -emit-sorted-sil -emit-sil -module-name pgo_si_inlinelarge -o - | %FileCheck %s --check-prefix=SIL-OPT
12
10
13
11
// REQUIRES: profile_runtime
14
12
// REQUIRES: executable_test
15
- // REQUIRES: OS=macosx
16
13
17
14
public func bar( _ x: Int64 ) -> Int64 {
18
15
if ( x == 0 ) {
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_si_reduce -o %t/main
3
3
4
- // This unusual use of 'sh' allows the path of the profraw file to be
5
- // substituted by %target-run.
6
4
// RUN: %target-codesign %t/main
7
- // RUN: %target-run sh -c ' env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
5
+ // RUN: env %env- LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main
8
6
9
7
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
10
8
// RUN: %target-swift-frontend %s -profile-use=%t/default.profdata -emit-sorted-sil -emit-sil -module-name pgo_si_reduce -o - | %FileCheck %s --check-prefix=SIL
11
9
// RUN: %target-swift-frontend %s -profile-use=%t/default.profdata -O -emit-sorted-sil -emit-sil -module-name pgo_si_reduce -o - | %FileCheck %s --check-prefix=SIL-OPT
12
10
13
11
// REQUIRES: profile_runtime
14
12
// REQUIRES: executable_test
15
- // REQUIRES: OS=macosx
16
13
17
14
public func bar( _ x: Int32 ) -> Int32 {
18
15
if ( x == 0 ) {
You can’t perform that action at this time.
0 commit comments