minix/sys/external/bsd/compiler_rt/dist/test/profile/lit.cfg
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

47 lines
1.6 KiB
Python

# -*- Python -*-
import os
# Setup config name.
config.name = 'Profile'
# Setup source root.
config.test_source_root = os.path.dirname(__file__)
# Setup executable root.
if hasattr(config, 'profile_lit_binary_dir') and \
config.profile_lit_binary_dir is not None:
config.test_exec_root = config.profile_lit_binary_dir
# If the above check didn't work, we're probably in the source tree. Use some
# magic to re-execute from the build tree.
if config.test_exec_root is None:
# The magic relies on knowing compilerrt_site_basedir.
compilerrt_basedir = lit_config.params.get('compilerrt_site_basedir', None)
if compilerrt_basedir:
site_cfg = os.path.join(compilerrt_basedir, 'profile', 'lit.site.cfg')
if os.path.exists(site_cfg):
lit_config.load_config(config, site_cfg)
raise SystemExit
# Test suffixes.
config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']
# What to exclude.
config.excludes = ['Inputs']
# Clang flags.
clang_cflags = [config.target_cflags]
def build_invocation(compile_flags):
return " " + " ".join([config.clang] + compile_flags) + " "
# Add clang substitutions.
config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
config.substitutions.append( ("%clang_profgen ", build_invocation(clang_cflags) + " -fprofile-instr-generate ") )
config.substitutions.append( ("%clang_profuse=", build_invocation(clang_cflags) + " -fprofile-instr-use=") )
# Profile tests are currently supported on Linux and Darwin only.
if config.host_os not in ['Linux', 'Darwin']:
config.unsupported = True