Skip to content

[test] Enable some profiler tests on non-macOS #75572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions test/Profiler/coverage_errors_exec.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

struct Err: Error {}

Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/coverage_optimized_report.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

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

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

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

Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/coverage_pound_if_exec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

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

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// The line count here excludes the inactive regions.
// SUMMARY: "lines":{"count":41,"covered":0
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/coverage_relative_path_exec.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

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

Expand All @@ -14,10 +13,8 @@

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

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// RUN: %llvm-cov show %t/main -instr-profile=%t/default.profdata | %FileCheck --check-prefix SHOW %s
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/coverage_smoke.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -Xfrontend -disable-incremental-llvm-codegen -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// CHECK-INTERNAL: Functions shown: 1
// CHECK-COV: {{ *}}[[@LINE+1]]|{{ *}}1{{.*}}func f_internal
Expand Down
2 changes: 0 additions & 2 deletions test/Profiler/coverage_with_asan.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// RUN: %target-swift-frontend %s -profile-generate -profile-coverage-mapping -sanitize=address -emit-ir -o - | %FileCheck %s
// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s

// REQUIRES: OS=macosx

// CHECK: main
func main() {}
4 changes: 1 addition & 3 deletions test/Profiler/issue-42929.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -profile-coverage-mapping -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// RUN: %llvm-cov export -summary-only %t/main -instr-profile=%t/default.profdata | %FileCheck %s
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/pgo_checked_cast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_checked_cast -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// SIL-LABEL: // pgo_checked_cast.check1<A>(Any, A) -> A
// SIL-LABEL: sil @$s16pgo_checked_cast6check1yxyp_xtlF : $@convention(thin) <T> (@in_guaranteed Any, @in_guaranteed T) -> @out T !function_entry_count(5001) {
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/pgo_foreach.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_foreach -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// UNSUPPORTED: swift_test_mode_optimize_none_with_implicit_dynamic

Expand Down
9 changes: 3 additions & 6 deletions test/Profiler/pgo_guard.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_guard -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// SIL-LABEL: // pgo_guard.guess1
// SIL-LABEL: sil @$s9pgo_guard6guess11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5002) {
// IR-LABEL: define swiftcc i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
// IR-OPT-LABEL: define swiftcc{{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
// IR-LABEL: define {{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"
// IR-OPT-LABEL: define {{.*}} i32 @"$s9pgo_guard6guess11xs5Int32VAE_tF"

public func guess1(x: Int32) -> Int32 {
// SIL: cond_br {{.*}} !true_count(5000) !false_count(2)
Expand Down
13 changes: 5 additions & 8 deletions test/Profiler/pgo_if.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_if -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// 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
Expand All @@ -13,13 +11,12 @@
// 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

// REQUIRES: profile_runtime
// REQUIRES: OS=macosx
// REQUIRES: executable_test

// SIL-LABEL: // pgo_if.guess1
// SIL-LABEL: sil @$s6pgo_if6guess11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5001) {
// IR-LABEL: define swiftcc i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
// IR-OPT-LABEL: define swiftcc{{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
// IR-LABEL: define {{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
// IR-OPT-LABEL: define {{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
public func guess1(x: Int32) -> Int32 {
// SIL: cond_br {{.*}} !true_count(5000) !false_count(1)
// SIL-OPT: cond_br {{.*}} !true_count(5000) !false_count(1)
Expand All @@ -34,8 +31,8 @@ public func guess1(x: Int32) -> Int32 {

// SIL-LABEL: // pgo_if.guess2
// SIL-LABEL: sil @$s6pgo_if6guess21xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5001) {
// IR-LABEL: define swiftcc i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
// IR-OPT-LABEL: define swiftcc{{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
// IR-LABEL: define {{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
// IR-OPT-LABEL: define {{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
public func guess2(x: Int32) -> Int32 {
// SIL: cond_br {{.*}} !true_count(5000) !false_count(1)
// SIL-OPT: cond_br {{.*}} !true_count(5000) !false_count(1)
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/pgo_lazy.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_lazy -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata

Expand All @@ -15,7 +13,6 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

var cond = true

Expand Down
9 changes: 3 additions & 6 deletions test/Profiler/pgo_repeatwhile.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_repeatwhile -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// 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
Expand All @@ -15,12 +13,11 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// SIL-LABEL: // pgo_repeatwhile.guessWhile
// SIL-LABEL: sil @$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(42) {
// IR-LABEL: define swiftcc i32 @"$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF"
// IR-OPT-LABEL: define swiftcc i32 @"$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF"
// IR-LABEL: define {{.*}} i32 @"$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF"
// IR-OPT-LABEL: define {{.*}} i32 @"$s15pgo_repeatwhile10guessWhile1xs5Int32VAE_tF"

public func guessWhile(x: Int32) -> Int32 {
// SIL: cond_br {{.*}} !true_count(176400) !false_count(420)
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/pgo_switchenum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_switchenum -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// need to move counts attached to expr for this
Expand All @@ -19,7 +17,6 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

public enum MaybePair {
case Neither
Expand Down
9 changes: 3 additions & 6 deletions test/Profiler/pgo_while.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_while -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// 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
Expand All @@ -15,12 +13,11 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// SIL-LABEL: // pgo_while.guessWhile
// SIL-LABEL: sil @$s9pgo_while10guessWhile1xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(42) {
// IR-LABEL: define swiftcc i32 @"$s9pgo_while10guessWhile1xs5Int32VAE_tF"
// IR-OPT-LABEL: define swiftcc i32 @"$s9pgo_while10guessWhile1xs5Int32VAE_tF"
// IR-LABEL: define {{.*}} i32 @"$s9pgo_while10guessWhile1xs5Int32VAE_tF"
// IR-OPT-LABEL: define {{.*}} i32 @"$s9pgo_while10guessWhile1xs5Int32VAE_tF"

public func guessWhile(x: Int32) -> Int32 {
// SIL: cond_br {{.*}} !true_count(420) !false_count(42)
Expand Down
5 changes: 1 addition & 4 deletions test/Profiler/pgo_with_coverage.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_with_coverage -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata

Expand All @@ -13,7 +11,6 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

// Make sure we don't try and profile implicit decls during PGO.
// IR-NOT: no profile data available
Expand Down
7 changes: 2 additions & 5 deletions test/Profiler/rdar77217762_coverage.sil
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +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
// 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

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main1
// RUN: %target-codesign %t/main2
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default1.profraw %t/main1
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default2.profraw %t/main2
// RUN: env %env-LLVM_PROFILE_FILE=%t/default1.profraw %target-run %t/main1
// RUN: env %env-LLVM_PROFILE_FILE=%t/default2.profraw %target-run %t/main2

// RUN: %llvm-profdata merge %t/default1.profraw -o %t/default1.profdata
// RUN: %llvm-profdata merge %t/default2.profraw -o %t/default2.profdata
Expand All @@ -25,7 +23,6 @@

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

sil_stage canonical

Expand Down
5 changes: 1 addition & 4 deletions test/SILOptimizer/pgo_si_inlinelarge.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_si_inlinelarge -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// 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
// 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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

public func bar(_ x: Int64) -> Int64 {
if (x == 0) {
Expand Down
5 changes: 1 addition & 4 deletions test/SILOptimizer/pgo_si_reduce.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -profile-generate -Xfrontend -disable-incremental-llvm-codegen -module-name pgo_si_reduce -o %t/main

// This unusual use of 'sh' allows the path of the profraw file to be
// substituted by %target-run.
// RUN: %target-codesign %t/main
// RUN: %target-run sh -c 'env LLVM_PROFILE_FILE=$1 $2' -- %t/default.profraw %t/main
// RUN: env %env-LLVM_PROFILE_FILE=%t/default.profraw %target-run %t/main

// RUN: %llvm-profdata merge %t/default.profraw -o %t/default.profdata
// 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
// 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

// REQUIRES: profile_runtime
// REQUIRES: executable_test
// REQUIRES: OS=macosx

public func bar(_ x: Int32) -> Int32 {
if (x == 0) {
Expand Down