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
20
17
// SIL-LABEL: sil @$s6pgo_if6guess11xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5001) {
21
- // IR-LABEL: define swiftcc i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
22
- // IR-OPT-LABEL: define swiftcc {{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
18
+ // IR-LABEL: define {{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
19
+ // IR-OPT-LABEL: define {{.*}} i32 @"$s6pgo_if6guess11xs5Int32VAE_tF"
23
20
public func guess1( x: Int32 ) -> Int32 {
24
21
// SIL: cond_br {{.*}} !true_count(5000) !false_count(1)
25
22
// SIL-OPT: cond_br {{.*}} !true_count(5000) !false_count(1)
@@ -34,8 +31,8 @@ public func guess1(x: Int32) -> Int32 {
34
31
35
32
// SIL-LABEL: // pgo_if.guess2
36
33
// SIL-LABEL: sil @$s6pgo_if6guess21xs5Int32VAE_tF : $@convention(thin) (Int32) -> Int32 !function_entry_count(5001) {
37
- // IR-LABEL: define swiftcc i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
38
- // IR-OPT-LABEL: define swiftcc {{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
34
+ // IR-LABEL: define {{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
35
+ // IR-OPT-LABEL: define {{.*}} i32 @"$s6pgo_if6guess21xs5Int32VAE_tF"
39
36
public func guess2( x: Int32 ) -> Int32 {
40
37
// SIL: cond_br {{.*}} !true_count(5000) !false_count(1)
41
38
// SIL-OPT: cond_br {{.*}} !true_count(5000) !false_count(1)
0 commit comments