Skip to content

Commit ebce19a

Browse files
authored
Merge pull request #75572 from hamishknight/enable-profile-tests-non-macos
[test] Enable some profiler tests on non-macOS
2 parents 59c3dd2 + 3325296 commit ebce19a

19 files changed

+29
-84
lines changed

test/Profiler/coverage_errors_exec.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
33

4-
// This unusual use of 'sh' allows the path of the profraw file to be
5-
// substituted by %target-run.
64
// 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
86

97
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
108
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck %s
119

1210
// REQUIRES: profile_runtime
1311
// REQUIRES: executable_test
14-
// REQUIRES: OS=macosx
1512

1613
struct Err: Error {}
1714

test/Profiler/coverage_optimized_report.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -O -o %t/main
44

5-
// This unusual use of 'sh' allows the path of the profraw file to be
6-
// substituted by %target-run.
75
// 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
97

108
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
119
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s
1210

1311
// REQUIRES: profile_runtime
1412
// REQUIRES: executable_test
15-
// REQUIRES: OS=macosx
1613

1714
// CHECK: "lines":{"count":9,"covered":5{{.*}}"functions":{"count":5,"covered":3
1815

test/Profiler/coverage_pound_if_exec.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
44

5-
// This unusual use of 'sh' allows the path of the profraw file to be
6-
// substituted by %target-run.
75
// 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
97

108
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
119
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck --check-prefix SUMMARY %s
1210
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck --implicit-check-not "{{[ ]*\|[ ]*[0-9]+}}" %s
1311

1412
// REQUIRES: profile_runtime
1513
// REQUIRES: executable_test
16-
// REQUIRES: OS=macosx
1714

1815
// The line count here excludes the inactive regions.
1916
// SUMMARY: "lines":{"count":41,"covered":0

test/Profiler/coverage_relative_path_exec.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// REQUIRES: profile_runtime
22
// REQUIRES: executable_test
3-
// REQUIRES: OS=macosx
43

54
// This test is to make sure llvm-cov can deal with a coverage-prefix-map.
65

@@ -14,10 +13,8 @@
1413

1514
// 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
1615

17-
// This unusual use of 'sh' allows the path of the profraw file to be
18-
// substituted by %target-run.
1916
// 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
2118

2219
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
2320
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck --check-prefix SHOW %s

test/Profiler/coverage_smoke.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -Xfrontend -disable-incremental-llvm-codegen -o %t/main
33

4-
// This unusual use of 'sh' allows the path of the profraw file to be
5-
// substituted by %target-run.
64
// 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
86

97
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
108
// RUN: %llvm-profdata show %t/default.profdata -function=f_internal | %FileCheck %s --check-prefix=CHECK-INTERNAL
@@ -16,7 +14,6 @@
1614

1715
// REQUIRES: profile_runtime
1816
// REQUIRES: executable_test
19-
// REQUIRES: OS=macosx
2017

2118
// CHECK-INTERNAL: Functions shown: 1
2219
// CHECK-COV: {{ *}}[[@LINE+1]]|{{ *}}1{{.*}}func f_internal
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-swift-frontend %s -profile-generate -profile-coverage-mapping -sanitize=address -emit-ir -o - | %FileCheck %s
22
// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s
33

4-
// REQUIRES: OS=macosx
5-
64
// CHECK: main
75
func main() {}

test/Profiler/issue-42929.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main
33

4-
// This unusual use of 'sh' allows the path of the profraw file to be
5-
// substituted by %target-run.
64
// 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
86

97
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
108
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s

test/Profiler/pgo_checked_cast.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
// RUN: %empty-directory(%t)
33
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_checked_cast -o %t/main
44

5-
// This unusual use of 'sh' allows the path of the profraw file to be
6-
// substituted by %target-run.
75
// 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
97

108
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
119
// 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,7 +15,6 @@
1715

1816
// REQUIRES: profile_runtime
1917
// REQUIRES: executable_test
20-
// REQUIRES: OS=macosx
2118

2219
// SIL-LABEL: // pgo_checked_cast.check1<A>(Any, A) -> A
2320
// SIL-LABEL: sil @$s16pgo_checked_cast6check1yxyp_xtlF : $@convention(thin) <T> (@in_guaranteed Any, @in_guaranteed T) -> @out T !function_entry_count(5001) {

test/Profiler/pgo_foreach.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_foreach -o %t/main
33

4-
// This unusual use of 'sh' allows the path of the profraw file to be
5-
// substituted by %target-run.
64
// 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
86

97
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
108
// need to move counts attached to expr for this
@@ -18,7 +16,6 @@
1816

1917
// REQUIRES: profile_runtime
2018
// REQUIRES: executable_test
21-
// REQUIRES: OS=macosx
2219

2320
// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic
2421

test/Profiler/pgo_guard.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_guard -o %t/main
33

4-
// This unusual use of 'sh' allows the path of the profraw file to be
5-
// substituted by %target-run.
64
// 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
86

97
// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
108
// 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
@@ -14,12 +12,11 @@
1412

1513
// REQUIRES: profile_runtime
1614
// REQUIRES: executable_test
17-
// REQUIRES: OS=macosx
1815

1916
// SIL-LABEL: // pgo_guard.guess1
2017
// SIL-LABEL: sil @$s9pgo_guard6guess11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5002) {
21-
// IR-LABEL: define swiftcc i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
22-
// IR-OPT-LABEL: define swiftcc{{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
18+
// IR-LABEL: define {{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
19+
// IR-OPT-LABEL: define {{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
2320

2421
public func guess1(x: Int32) -> Int32 {
2522
// SIL: cond_br {{.*}} !true_count(5000) !false_count(2)

0 commit comments

Comments
 (0)