summaryrefslogtreecommitdiff
path: root/test/profile/lit.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'test/profile/lit.cfg')
-rw-r--r--test/profile/lit.cfg23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/profile/lit.cfg b/test/profile/lit.cfg
index 3512e0abcf1a6..a6e6ef81c6228 100644
--- a/test/profile/lit.cfg
+++ b/test/profile/lit.cfg
@@ -49,20 +49,35 @@ target_cflags=[get_required_attr(config, "target_cflags")]
clang_cflags = target_cflags + extra_linkflags
clang_cxxflags = config.cxx_mode_flags + clang_cflags
-def build_invocation(compile_flags):
- return " " + " ".join([config.clang] + compile_flags) + " "
+def build_invocation(compile_flags, with_lto = False):
+ lto_flags = []
+ lto_prefix = []
+ if with_lto and config.lto_supported:
+ lto_flags += config.lto_flags
+ lto_prefix += config.lto_launch
+ return " " + " ".join(lto_prefix + [config.clang] + lto_flags + compile_flags) + " "
# Add clang substitutions.
config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) )
config.substitutions.append( ("%clang_profgen ", build_invocation(clang_cflags) + " -fprofile-instr-generate ") )
config.substitutions.append( ("%clang_profgen=", build_invocation(clang_cflags) + " -fprofile-instr-generate=") )
-config.substitutions.append( ("%clang_profuse=", build_invocation(clang_cflags) + " -fprofile-instr-use=") )
+config.substitutions.append( ("%clang_pgogen ", build_invocation(clang_cflags) + " -fprofile-generate ") )
+config.substitutions.append( ("%clang_pgogen=", build_invocation(clang_cflags) + " -fprofile-generate=") )
+
config.substitutions.append( ("%clangxx_profgen ", build_invocation(clang_cxxflags) + " -fprofile-instr-generate ") )
-config.substitutions.append( ("%clangxx_profuse=", build_invocation(clang_cxxflags) + " -fprofile-instr-use=") )
+config.substitutions.append( ("%clangxx_profgen=", build_invocation(clang_cxxflags) + " -fprofile-instr-generate=") )
+config.substitutions.append( ("%clangxx_pgogen ", build_invocation(clang_cxxflags) + " -fprofile-generate ") )
+config.substitutions.append( ("%clangxx_pgogen=", build_invocation(clang_cxxflags) + " -fprofile-generate=") )
+
config.substitutions.append( ("%clang_profgen_gcc=", build_invocation(clang_cflags) + " -fprofile-generate=") )
config.substitutions.append( ("%clang_profuse_gcc=", build_invocation(clang_cflags) + " -fprofile-use=") )
+config.substitutions.append( ("%clang_profuse=", build_invocation(clang_cflags) + " -fprofile-instr-use=") )
+config.substitutions.append( ("%clangxx_profuse=", build_invocation(clang_cxxflags) + " -fprofile-instr-use=") )
+
+config.substitutions.append( ("%clang_lto_profgen=", build_invocation(clang_cflags, True) + " -fprofile-instr-generate=") )
+
if config.host_os not in ['Darwin', 'FreeBSD', 'Linux']:
config.unsupported = True