[poolalloc] r230917 - Update lit-related testing code to include changes made to trunk.
Will Dietz
wdietz2 at illinois.edu
Sun Mar 1 14:12:14 PST 2015
Author: wdietz2
Date: Sun Mar 1 16:12:14 2015
New Revision: 230917
URL: http://llvm.org/viewvc/llvm-project?rev=230917&view=rev
Log:
Update lit-related testing code to include changes made to trunk.
Modified:
poolalloc/trunk/test/Makefile
poolalloc/trunk/test/lit.cfg
poolalloc/trunk/test/lit.site.cfg.in
Modified: poolalloc/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- poolalloc/trunk/test/Makefile (original)
+++ poolalloc/trunk/test/Makefile Sun Mar 1 16:12:14 2015
@@ -414,23 +414,36 @@ FORCE:
lit.site.cfg: FORCE
@echo "Making Poolalloc/DSA 'lit.site.cfg' file..."
- @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g > lit.tmp
+ @$(ECHOPATH) s=@LLVM_HOST_TRIPLE@=$(HOST_TRIPLE)=g > lit.tmp
+ @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
+ @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(LLVMToolDir)=g >> lit.tmp
+ @$(ECHOPATH) s=@LLVM_LIBRARY_DIR@=$(LibDir)=g >> lit.tmp
@$(ECHOPATH) s=@PROJ_SRC_ROOT@=$(PROJ_SRC_ROOT)=g >> lit.tmp
@$(ECHOPATH) s=@PROJ_OBJ_ROOT@=$(PROJ_OBJ_ROOT)=g >> lit.tmp
- @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(LLVMToolDir)=g >> lit.tmp
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
@$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
+ @$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
- @$(ECHOPATH) s, at OCAMLOPT@,$(OCAMLOPT) -cc \\\\\"$(CXX_FOR_OCAMLOPT)\\\\\" -I $(LibDir)/ocaml,g >> lit.tmp
+ @$(ECHOPATH) s=@GOLD_EXECUTABLE@=ld=g >> lit.tmp
+ @$(ECHOPATH) s=@OCAMLFIND@=$(OCAMLFIND)=g >> lit.tmp
+ @$(ECHOPATH) s!@OCAMLFLAGS@!$(addprefix -cclib ,$(LDFLAGS))!g >> lit.tmp
+ @$(ECHOPATH) s=@HAVE_OCAMLOPT@=$(HAVE_OCAMLOPT)=g >> lit.tmp
+ @$(ECHOPATH) s=@HAVE_OCAML_OUNIT@=$(HAVE_OCAML_OUNIT)=g >> lit.tmp
+ @$(ECHOPATH) s=@GO_EXECUTABLE@=$(GO)=g >> lit.tmp
+ @$(ECHOPATH) s!@HOST_CC@!$(CC)!g >> lit.tmp
+ @$(ECHOPATH) s!@HOST_CXX@!$(CXX)!g >> lit.tmp
+ @$(ECHOPATH) s!@HOST_LDFLAGS@!$(LDFLAGS)!g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
@$(ECHOPATH) s=@TARGETS_TO_BUILD@=$(TARGETS_TO_BUILD)=g >> lit.tmp
@$(ECHOPATH) s=@LLVM_BINDINGS@=$(BINDINGS_TO_BUILD)=g >> lit.tmp
@$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> lit.tmp
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
- @sed -f lit.tmp $(PROJ_SRC_ROOT)/test/lit.site.cfg.in > $@
+ @$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp
+ @$(ECHOPATH) s=@HAVE_DIA_SDK@=0=g >> lit.tmp
+ @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
@-rm -f lit.tmp
#Run the lit tests for this project
Modified: poolalloc/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.cfg?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- poolalloc/trunk/test/lit.cfg (original)
+++ poolalloc/trunk/test/lit.cfg Sun Mar 1 16:12:14 2015
@@ -106,6 +106,31 @@ for symbolizer in ['ASAN_SYMBOLIZER_PATH
if symbolizer in os.environ:
config.environment[symbolizer] = os.environ[symbolizer]
+# Set up OCAMLPATH to include newly built OCaml libraries.
+llvm_lib_dir = getattr(config, 'llvm_lib_dir', None)
+if llvm_lib_dir is None:
+ if llvm_obj_root is not None:
+ llvm_lib_dir = os.path.join(llvm_obj_root, 'lib')
+
+if llvm_lib_dir is not None:
+ llvm_ocaml_lib = os.path.join(llvm_lib_dir, 'ocaml')
+ if llvm_ocaml_lib is not None:
+ if 'OCAMLPATH' in os.environ:
+ ocamlpath = os.path.pathsep.join((llvm_ocaml_lib, os.environ['OCAMLPATH']))
+ config.environment['OCAMLPATH'] = ocamlpath
+ else:
+ config.environment['OCAMLPATH'] = llvm_ocaml_lib
+
+ if 'CAML_LD_LIBRARY_PATH' in os.environ:
+ caml_ld_library_path = os.path.pathsep.join((llvm_ocaml_lib,
+ os.environ['CAML_LD_LIBRARY_PATH']))
+ config.environment['CAML_LD_LIBRARY_PATH'] = caml_ld_library_path
+ else:
+ config.environment['CAML_LD_LIBRARY_PATH'] = llvm_ocaml_lib
+
+# Set up OCAMLRUNPARAM to enable backtraces in OCaml tests.
+config.environment['OCAMLRUNPARAM'] = 'b'
+
###
import os
@@ -175,38 +200,25 @@ if re.search(r'win32', config.target_tri
llc_dwarf += ' -mtriple='+config.target_triple.replace('-win32', '-mingw32')
config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
-# Provide a substition for those tests that need to run the jit to obtain data
-# but simply want use the currently considered most reliable jit for platform
-# FIXME: ppc32 is not ready for mcjit.
-if 'arm' in config.target_triple \
- or 'aarch64' in config.target_triple \
- or 'powerpc64' in config.target_triple \
- or 's390x' in config.target_triple:
- defaultIsMCJIT = 'true'
-else:
- defaultIsMCJIT = 'false'
-config.substitutions.append( ('%defaultjit', '-use-mcjit='+defaultIsMCJIT) )
-
-# Process jit implementation option
-jit_impl_cfg = lit_config.params.get('jit_impl', None)
-if jit_impl_cfg == 'mcjit':
- # When running with mcjit, mangle -mcjit into target triple
- # and add -use-mcjit flag to lli invocation
- if 'i386' in config.target_triple or 'i686' in config.target_triple:
- config.target_triple += jit_impl_cfg + '-ia32'
- elif 'x86_64' in config.target_triple:
- config.target_triple += jit_impl_cfg + '-ia64'
- else:
- config.target_triple += jit_impl_cfg
-
- config.substitutions.append( ('%lli', 'lli -use-mcjit') )
-else:
- config.substitutions.append( ('%lli', 'lli') )
-
# Add site-specific substitutions.
-config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
+config.substitutions.append( ('%gold', config.gold_executable) )
+config.substitutions.append( ('%go', config.go_executable) )
config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
+config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
+config.substitutions.append( ('%python', config.python_executable) )
+
+# OCaml substitutions.
+# Support tests for both native and bytecode builds.
+config.substitutions.append( ('%ocamlc',
+ "%s ocamlc -cclib -L%s %s" %
+ (config.ocamlfind_executable, llvm_lib_dir, config.ocaml_flags)) )
+if config.have_ocamlopt in ('1', 'TRUE'):
+ config.substitutions.append( ('%ocamlopt',
+ "%s ocamlopt -cclib -L%s -cclib -Wl,-rpath,%s %s" %
+ (config.ocamlfind_executable, llvm_lib_dir, llvm_lib_dir, config.ocaml_flags)) )
+else:
+ config.substitutions.append( ('%ocamlopt', "true" ) )
# For each occurrence of an llvm tool name as its own word, replace it
# with the full path to the build directory holding that tool. This
@@ -226,7 +238,6 @@ for pattern in [r"\bbugpoint\b(?!-)",
NOJUNK + r"\bclang\b(?!-)",
NOJUNK + r"\bllc\b",
r"\blli\b",
- r"\bllvm-PerfectShuffle\b",
r"\bllvm-ar\b",
r"\bllvm-as\b",
r"\bllvm-bcanalyzer\b",
@@ -234,8 +245,10 @@ for pattern in [r"\bbugpoint\b(?!-)",
r"\bllvm-cov\b",
r"\bllvm-diff\b",
r"\bllvm-dis\b",
+ r"\bllvm-dsymutil\b",
r"\bllvm-dwarfdump\b",
r"\bllvm-extract\b",
+ r"\bllvm-go\b",
r"\bllvm-link\b",
r"\bllvm-lto\b",
r"\bllvm-mc\b",
@@ -248,15 +261,14 @@ for pattern in [r"\bbugpoint\b(?!-)",
r"\bllvm-rtdyld\b",
r"\bllvm-size\b",
r"\bllvm-tblgen\b",
+ r"\bllvm-vtabledump\b",
r"\bllvm-c-test\b",
r"\bmacho-dump\b",
NOJUNK + r"\bopt\b",
r"\bFileCheck\b",
- r"\bFileUpdate\b",
- r"\bc-index-test\b",
- r"\bfpcmp\b",
r"\bobj2yaml\b",
r"\byaml2obj\b",
+ r"\bverify-uselistorder\b",
# Handle these specially as they are strings searched
# for during testing.
r"\| \bcount\b",
@@ -274,8 +286,17 @@ for pattern in [r"\bbugpoint\b(?!-)",
# Warn, but still provide a substitution.
lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir)
tool_path = llvm_tools_dir + '/' + tool_name
+ if (tool_name == "llc" and
+ 'LLVM_ENABLE_MACHINE_VERIFIER' in os.environ and
+ os.environ['LLVM_ENABLE_MACHINE_VERIFIER'] == "1"):
+ tool_path += " -verify-machineinstrs"
config.substitutions.append((pattern, tool_pipe + tool_path))
-### Helper tools
+
+### Targets
+
+config.targets = frozenset(config.targets_to_build.split())
+
+### DSA/PA Helper tools
dsa_so = config.llvm_shlib_dir + "/LLVMDataStructure" + config.llvm_shlib_ext
adsa_so = config.llvm_shlib_dir + "/AssistDS" + config.llvm_shlib_ext
@@ -312,10 +333,14 @@ if config.llvm_use_sanitizer == "Address
if (config.llvm_use_sanitizer == "Memory" or
config.llvm_use_sanitizer == "MemoryWithOrigins"):
config.available_features.add("msan")
+if config.llvm_use_sanitizer == "Undefined":
+ config.available_features.add("ubsan")
+else:
+ config.available_features.add("not_ubsan")
# Direct object generation
-if not 'hexagon' in config.target_triple and \
- not re.match('(arm|thumb).*windows', config.target_triple):
+# Suppress x86_64-mingw32 while investigating since r219108.
+if not 'hexagon' in config.target_triple and not re.match(r'^x86_64.*-(mingw32|windows-gnu|win32)', config.target_triple):
config.available_features.add("object-emission")
if config.have_zlib == "1":
@@ -329,12 +354,47 @@ else:
if config.host_triple == config.target_triple:
config.available_features.add("native")
-# Ask llvm-config about assertion mode.
import subprocess
+
+def have_ld_plugin_support():
+ if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
+ return False
+
+ ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE)
+ ld_out = ld_cmd.stdout.read().decode()
+ ld_cmd.wait()
+
+ if not '-plugin' in ld_out:
+ return False
+
+ # check that the used emulations are supported.
+ emu_line = [l for l in ld_out.split('\n') if 'supported emulations' in l]
+ if len(emu_line) != 1:
+ return False
+ emu_line = emu_line[0]
+ fields = emu_line.split(':')
+ if len(fields) != 3:
+ return False
+ emulations = fields[2].split()
+ if 'elf32ppc' not in emulations or 'elf_x86_64' not in emulations:
+ return False
+
+ ld_version = subprocess.Popen([config.gold_executable, '--version'], stdout = subprocess.PIPE)
+ if not 'GNU gold' in ld_version.stdout.read().decode():
+ return False
+ ld_version.wait()
+
+ return True
+
+if have_ld_plugin_support():
+ config.available_features.add('ld_plugin')
+
+# Ask llvm-config about assertion mode.
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
- stdout = subprocess.PIPE)
+ stdout = subprocess.PIPE,
+ env=config.environment)
except OSError:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
@@ -354,6 +414,10 @@ if 'darwin' == sys.platform:
config.available_features.add('fma3')
sysctl_cmd.wait()
+# .debug_frame is not emitted for targeting Windows x64.
+if not re.match(r'^x86_64.*-(mingw32|windows-gnu|win32)', config.target_triple):
+ config.available_features.add('debug_frame')
+
# Check if we should use gmalloc.
use_gmalloc_str = lit_config.params.get('use_gmalloc', None)
if use_gmalloc_str is not None:
Modified: poolalloc/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.site.cfg.in?rev=230917&r1=230916&r2=230917&view=diff
==============================================================================
--- poolalloc/trunk/test/lit.site.cfg.in (original)
+++ poolalloc/trunk/test/lit.site.cfg.in Sun Mar 1 16:12:14 2015
@@ -7,6 +7,7 @@ config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@"
config.proj_src_root = "@PROJ_SRC_ROOT@"
config.proj_obj_root = "@PROJ_OBJ_ROOT@"
@@ -15,16 +16,26 @@ config.llvm_shlib_ext = "@SHLIBEXT@"
config.llvm_exe_ext = "@EXEEXT@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
-config.ocamlopt_executable = "@OCAMLOPT@"
+config.gold_executable = "@GOLD_EXECUTABLE@"
+config.ocamlfind_executable = "@OCAMLFIND@"
+config.have_ocamlopt = "@HAVE_OCAMLOPT@"
+config.have_ocaml_ounit = "@HAVE_OCAML_OUNIT@"
+config.ocaml_flags = "@OCAMLFLAGS@"
+config.go_executable = "@GO_EXECUTABLE@"
config.enable_shared = @ENABLE_SHARED@
config.enable_assertions = @ENABLE_ASSERTIONS@
config.targets_to_build = "@TARGETS_TO_BUILD@"
config.llvm_bindings = "@LLVM_BINDINGS@"
config.host_os = "@HOST_OS@"
config.host_arch = "@HOST_ARCH@"
+config.host_cc = "@HOST_CC@"
+config.host_cxx = "@HOST_CXX@"
+config.host_ldflags = "@HOST_LDFLAGS@"
config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.have_zlib = "@HAVE_LIBZ@"
+config.have_dia_sdk = @HAVE_DIA_SDK@
+config.enable_ffi = "@LLVM_ENABLE_FFI@"
# Support substitution of the tools_dir with user parameters. This is
# used when we can't determine the tool dir at configuration time.
More information about the llvm-commits
mailing list