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

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 11:27:34 PDT 2017


jakehehrlich created this revision.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D39465

Files:
  test/lit.cfg.py
  test/lit.site.cfg.py.in


Index: test/lit.site.cfg.py.in
===================================================================
--- test/lit.site.cfg.py.in
+++ test/lit.site.cfg.py.in
@@ -42,6 +42,7 @@
 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.
Index: test/lit.cfg.py
===================================================================
--- test/lit.cfg.py
+++ test/lit.cfg.py
@@ -168,6 +168,11 @@
     config.available_features.add(arch.lower() + '-registered-target')
 
 # Features
+config.available_features.add(config.host_arch + "-host-arch")
+
+for host_arch64 in ["x86_64", "mips64", "ppc64", "aarch64"]:
+  if config.llvm_host_triple.startswith(host_arch64):
+    config.available_features.add("host-arch-is-64bit")
 
 # Others/can-execute.txt
 if sys.platform not in ['win32']:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39465.121023.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171031/a450d74a/attachment.bin>


More information about the llvm-commits mailing list