[llvm] r317281 - Add feature to determine if host architecture is 64-bit in llvm-lit

Jake Ehrlich via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 16:14:56 PDT 2017


Author: jakehehrlich
Date: Thu Nov  2 16:14:55 2017
New Revision: 317281

URL: http://llvm.org/viewvc/llvm-project?rev=317281&view=rev
Log:
Add feature to determine if host architecture is 64-bit in llvm-lit

I have a test that I'd like to add to llvm that demands using more than
32-bits worth of address space. This test can't be run on 32-bit systems
because they don't have enough address space. The host triple should be
used to determine this instead of config.host_arch because on Debian
systems config.host_arch is not correct. This change adds the
"host-arch-is-64bit" feature to allow tests to restrict themselves to
the 64-bit case.

Differential Revision: https://reviews.llvm.org/D39465

Modified:
    llvm/trunk/test/lit.cfg.py
    llvm/trunk/test/lit.site.cfg.py.in

Modified: llvm/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg.py?rev=317281&r1=317280&r2=317281&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg.py (original)
+++ llvm/trunk/test/lit.cfg.py Thu Nov  2 16:14:55 2017
@@ -168,6 +168,9 @@ for arch in config.targets_to_build.spli
     config.available_features.add(arch.lower() + '-registered-target')
 
 # Features
+known_arches = ["x86_64", "mips64", "ppc64", "aarch64"]
+if any(config.llvm_host_triple.startswith(x) for x in known_arches):
+  config.available_features.add("llvm-64-bits")
 
 # Others/can-execute.txt
 if sys.platform not in ['win32']:

Modified: llvm/trunk/test/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.py.in?rev=317281&r1=317280&r2=317281&view=diff
==============================================================================
--- llvm/trunk/test/lit.site.cfg.py.in (original)
+++ llvm/trunk/test/lit.site.cfg.py.in Thu Nov  2 16:14:55 2017
@@ -29,7 +29,6 @@ config.targets_to_build = "@TARGETS_TO_B
 config.native_target = "@LLVM_NATIVE_ARCH@"
 config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
 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@"
@@ -42,6 +41,7 @@ config.enable_ffi = @LLVM_ENABLE_FFI@
 config.build_shared_libs = @BUILD_SHARED_LIBS@
 config.link_llvm_dylib = @LLVM_LINK_LLVM_DYLIB@
 config.llvm_libxml2_enabled = "@LLVM_LIBXML2_ENABLED@"
+config.llvm_host_triple = '@LLVM_HOST_TRIPLE@'
 
 # 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