# Do not edit!
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.asan_source_dir = "@ASAN_SOURCE_DIR@"
config.bits = "32"
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
+lit_config.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
# Do not edit!
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.asan_source_dir = "@ASAN_SOURCE_DIR@"
config.bits = "64"
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
+lit_config.load_config(config, "@ASAN_SOURCE_DIR@/lit_tests/lit.cfg")
# Do not edit!
# Load common config for all compiler-rt unit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Setup config name.
config.name = 'AddressSanitizer-Unit'
import os
+import lit.util
+
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-asan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-asan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system.
- asan_site_cfg = lit.params.get('asan_site_config', None)
+ asan_site_cfg = lit_config.params.get('asan_site_config', None)
if (asan_site_cfg) and (os.path.exists(asan_site_cfg)):
- lit.load_config(config, asan_site_cfg)
+ lit_config.load_config(config, asan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
if (not asan_site_cfg) or (not os.path.exists(asan_site_cfg)):
DisplayNoConfigMessage()
- lit.load_config(config, asan_site_cfg)
+ lit_config.load_config(config, asan_site_cfg)
raise SystemExit
# Setup default compiler flags used with -fsanitize=address option.
asan_source_dir = get_required_attr(config, "asan_source_dir")
asan_symbolize = os.path.join(asan_source_dir, "scripts", "asan_symbolize.py")
if not os.path.exists(asan_symbolize):
- lit.fatal("Can't find script on path %r" % asan_symbolize)
+ lit_config.fatal("Can't find script on path %r" % asan_symbolize)
config.substitutions.append( ("%asan_symbolize", " " + asan_symbolize + " ") )
# Define CHECK-%os to check for OS-dependent output.
import os
+import lit.util
+
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-dfsan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-dfsan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system.
- dfsan_site_cfg = lit.params.get('dfsan_site_config', None)
+ dfsan_site_cfg = lit_config.params.get('dfsan_site_config', None)
if (dfsan_site_cfg) and (os.path.exists(dfsan_site_cfg)):
- lit.load_config(config, dfsan_site_cfg)
+ lit_config.load_config(config, dfsan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
if (not dfsan_site_cfg) or (not os.path.exists(dfsan_site_cfg)):
DisplayNoConfigMessage()
- lit.load_config(config, dfsan_site_cfg)
+ lit_config.load_config(config, dfsan_site_cfg)
raise SystemExit
# Setup default compiler flags used with -fsanitize=dataflow option.
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@DFSAN_SOURCE_DIR@/lit_tests/lit.cfg")
+lit_config.load_config(config, "@DFSAN_SOURCE_DIR@/lit_tests/lit.cfg")
import os
import platform
+import lit.formats
+
# Setup test format
execute_external = (platform.system() != 'Windows'
- or lit.getBashPath() not in [None, ""])
+ or lit_config.getBashPath() not in [None, ""])
config.test_format = lit.formats.ShTest(execute_external)
# Setup clang binary.
clang_path = getattr(config, 'clang', None)
if (not clang_path) or (not os.path.exists(clang_path)):
- lit.fatal("Can't find Clang on path %r" % clang_path)
+ lit_config.fatal("Can't find Clang on path %r" % clang_path)
# Clear some environment variables that might affect Clang.
possibly_dangerous_env_vars = ['COMPILER_PATH', 'RC_DEBUG_OPTIONS',
# Tweak PATH to include llvm tools dir.
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)):
- lit.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
+ lit_config.fatal("Invalid llvm_tools_dir config attribute: %r" % llvm_tools_dir)
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
# LLVM tools dir can be passed in lit parameters, so try to
# apply substitution.
try:
- config.llvm_tools_dir = config.llvm_tools_dir % lit.params
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
except KeyError,e:
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
+ lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Setup attributes common for all compiler-rt projects.
-lit.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.cfg")
+lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.cfg")
# LLVM tools dir and build mode can be passed in lit parameters,
# so try to apply substitution.
try:
- config.llvm_tools_dir = config.llvm_tools_dir % lit.params
- config.llvm_build_mode = config.llvm_build_mode % lit.params
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.llvm_build_mode = config.llvm_build_mode % lit_config.params
except KeyError,e:
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
+ lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Setup attributes common for all compiler-rt unit tests.
-lit.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.unit.cfg")
+lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/lib/lit.common.unit.cfg")
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
lsan_lit_src_root = get_required_attr(config, "lsan_lit_src_root")
lsan_lit_cfg = os.path.join(lsan_lit_src_root, "lit.common.cfg")
if not os.path.exists(lsan_lit_cfg):
- lit.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg)
-lit.load_config(config, lsan_lit_cfg)
+ lit_config.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg)
+lit_config.load_config(config, lsan_lit_cfg)
config.name = 'LeakSanitizer-AddressSanitizer'
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@"
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/AsanConfig/lit.cfg")
+lit_config.load_config(config, "@LSAN_LIT_SOURCE_DIR@/AsanConfig/lit.cfg")
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
lsan_lit_src_root = get_required_attr(config, "lsan_lit_src_root")
lsan_lit_cfg = os.path.join(lsan_lit_src_root, "lit.common.cfg")
if not os.path.exists(lsan_lit_cfg):
- lit.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg)
-lit.load_config(config, lsan_lit_cfg)
+ lit_config.fatal("Can't find common LSan lit config at: %r" % lsan_lit_cfg)
+lit_config.load_config(config, lsan_lit_cfg)
config.name = 'LeakSanitizer-Standalone'
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Tool-specific config options.
config.lsan_lit_src_root = "@LSAN_LIT_SOURCE_DIR@"
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@LSAN_LIT_SOURCE_DIR@/LsanConfig/lit.cfg")
+lit_config.load_config(config, "@LSAN_LIT_SOURCE_DIR@/LsanConfig/lit.cfg")
# Do not edit!
# Load common config for all compiler-rt unit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Setup config name.
config.name = 'LeakSanitizer-Unit'
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup source root.
# Do not edit!
# Load common config for all compiler-rt unit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Setup config name.
config.name = 'MemorySanitizer-Unit'
import os
+import lit.util
+
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-msan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-msan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system.
- msan_site_cfg = lit.params.get('msan_site_config', None)
+ msan_site_cfg = lit_config.params.get('msan_site_config', None)
if (msan_site_cfg) and (os.path.exists(msan_site_cfg)):
- lit.load_config(config, msan_site_cfg)
+ lit_config.load_config(config, msan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
if (not msan_site_cfg) or (not os.path.exists(msan_site_cfg)):
DisplayNoConfigMessage()
- lit.load_config(config, msan_site_cfg)
+ lit_config.load_config(config, msan_site_cfg)
raise SystemExit
# Setup default compiler flags used with -fsanitize=memory option.
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@MSAN_SOURCE_DIR@/lit_tests/lit.cfg")
+lit_config.load_config(config, "@MSAN_SOURCE_DIR@/lit_tests/lit.cfg")
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup attributes common for all compiler-rt projects.
compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
"lit.common.unit.cfg")
-lit.load_config(config, compiler_rt_lit_unit_cfg)
+lit_config.load_config(config, compiler_rt_lit_unit_cfg)
# Setup config name.
config.name = 'SanitizerCommon-Unit'
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
try:
- config.llvm_build_mode = config.llvm_build_mode % lit.params
+ config.llvm_build_mode = config.llvm_build_mode % lit_config.params
except KeyError,e:
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
+ lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key))
# Let the main config do the real work.
-lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
+lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
# Do not edit!
# Load common config for all compiler-rt unit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.unit.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg")
+lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/Unit/lit.cfg")
import os
+import lit.util
+
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-tsan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-tsan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system.
- tsan_site_cfg = lit.params.get('tsan_site_config', None)
+ tsan_site_cfg = lit_config.params.get('tsan_site_config', None)
if (tsan_site_cfg) and (os.path.exists(tsan_site_cfg)):
- lit.load_config(config, tsan_site_cfg)
+ lit_config.load_config(config, tsan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
if (not tsan_site_cfg) or (not os.path.exists(tsan_site_cfg)):
DisplayNoConfigMessage()
- lit.load_config(config, tsan_site_cfg)
+ lit_config.load_config(config, tsan_site_cfg)
raise SystemExit
# Setup environment variables for running ThreadSanitizer.
# Do not edit!
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
+lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
def get_required_attr(config, attr_name):
attr_value = getattr(config, attr_name, None)
if not attr_value:
- lit.fatal("No attribute %r in test configuration! You may need to run "
- "tests from your build directory or add this attribute "
- "to lit.site.cfg " % attr_name)
+ lit_config.fatal(
+ "No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
return attr_value
# Setup config name.
config.test_source_root = os.path.dirname(__file__)
def DisplayNoConfigMessage():
- lit.fatal("No site specific configuration available! " +
- "Try running your test from the build tree or running " +
- "make check-ubsan")
+ lit_config.fatal("No site specific configuration available! " +
+ "Try running your test from the build tree or running " +
+ "make check-ubsan")
# Figure out LLVM source root.
llvm_src_root = getattr(config, 'llvm_src_root', None)
# We probably haven't loaded the site-specific configuration: the user
# is likely trying to run a test file directly, and the site configuration
# wasn't created by the build system or we're performing an out-of-tree build.
- ubsan_site_cfg = lit.params.get('ubsan_site_config', None)
+ ubsan_site_cfg = lit_config.params.get('ubsan_site_config', None)
if ubsan_site_cfg and os.path.exists(ubsan_site_cfg):
- lit.load_config(config, ubsan_site_cfg)
+ lit_config.load_config(config, ubsan_site_cfg)
raise SystemExit
# Try to guess the location of site-specific configuration using llvm-config
if not ubsan_site_cfg or not os.path.exists(ubsan_site_cfg):
DisplayNoConfigMessage()
- lit.load_config(config, ubsan_site_cfg)
+ lit_config.load_config(config, ubsan_site_cfg)
raise SystemExit
# Define %clang substitution to use in test RUN lines.
# Do not edit!
# Load common config for all compiler-rt lit tests.
-lit.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
+lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/lib/lit.common.configured")
# Load tool-specific config that would do the real work.
-lit.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
+lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")