Skip to content

Commit 984d5d6

Browse files
author
Wael Yehia
committed
[PGO] Use fprofile-continuous in more compiler-rt tests
1 parent 6c6495c commit 984d5d6

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

compiler-rt/test/profile/ContinuousSyncMode/pid-substitution.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// REQUIRES: continuous-mode
22

33
// RUN: rm -rf %t.dir && mkdir -p %t.dir
4-
// RUN: %clang_pgogen_cont -o %t.exe %s
54
//
65
// Note: %%p is needed here, not %p, because of lit's path substitution.
6+
// RUN: %clang_profgen=%t.dir/-%%p -fprofile-continuous -o %t.exe %s
7+
// RUN: %run %t.exe
8+
// RUN: %clang_pgogen -fprofile-continuous -o %t.exe %s
79
// RUN: env LLVM_PROFILE_FILE="%t.dir/%c-%%p" %run %t.exe
810

911
#include <stdlib.h>

compiler-rt/test/profile/ContinuousSyncMode/runtime-counter-relocation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: target={{.*(linux|solaris|windows-msvc|aix).*}}
22

3-
// RUN: %clang -fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation=true -o %t.exe %s
3+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -o %t.exe %s
44
// RUN: echo "garbage" > %t.profraw
5-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
5+
// RUN: %run %t.exe
66
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s -check-prefix=CHECK-COUNTS
77
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
88
// RUN: %if !target={{.*aix.*}} %{ llvm-cov report %t.exe -instr-profile %t.profdata | FileCheck %s -check-prefix=CHECK-COVERAGE %}

compiler-rt/test/profile/lit.cfg.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ def get_required_attr(config, attr_name):
3030

3131
target_is_msvc = bool(re.match(r".*-windows-msvc$", config.target_triple))
3232

33-
# Whether continous profile collection (%c) requires runtime counter relocation on this platform
34-
runtime_reloc = bool(config.host_os in ["AIX", "Linux"])
35-
3633
if config.host_os in ["Linux"]:
3734
extra_link_flags = ["-ldl"]
3835
elif target_is_msvc:
@@ -97,14 +94,6 @@ def exclude_unsupported_files_for_aix(dirname):
9794
config.substitutions.append(
9895
("%clang_profgen=", build_invocation(clang_cflags) + " -fprofile-instr-generate=")
9996
)
100-
config.substitutions.append(
101-
(
102-
"%clang_profgen_cont ",
103-
build_invocation(clang_cflags)
104-
+ " -fprofile-instr-generate "
105-
+ ("-mllvm -runtime-counter-relocation " if runtime_reloc else ""),
106-
)
107-
)
10897
config.substitutions.append(
10998
(
11099
"%clangxx_profgen ",
@@ -124,28 +113,12 @@ def exclude_unsupported_files_for_aix(dirname):
124113
config.substitutions.append(
125114
("%clang_pgogen=", build_invocation(clang_cflags) + " -fprofile-generate=")
126115
)
127-
config.substitutions.append(
128-
(
129-
"%clang_pgogen_cont ",
130-
build_invocation(clang_cflags)
131-
+ " -fprofile-generate "
132-
+ ("-mllvm -runtime-counter-relocation " if runtime_reloc else ""),
133-
)
134-
)
135116
config.substitutions.append(
136117
("%clangxx_pgogen ", build_invocation(clang_cxxflags) + " -fprofile-generate ")
137118
)
138119
config.substitutions.append(
139120
("%clangxx_pgogen=", build_invocation(clang_cxxflags) + " -fprofile-generate=")
140121
)
141-
config.substitutions.append(
142-
(
143-
"%clangxx_pgogen_cont ",
144-
build_invocation(clang_cxxflags)
145-
+ " -fprofile-generate "
146-
+ ("-mllvm -runtime-counter-relocation " if runtime_reloc else ""),
147-
)
148-
)
149122

150123
config.substitutions.append(
151124
("%clang_cspgogen ", build_invocation(clang_cflags) + " -fcs-profile-generate ")

0 commit comments

Comments
 (0)