diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py --- a/clang/test/lit.cfg.py +++ b/clang/test/lit.cfg.py @@ -1,7 +1,6 @@ # -*- Python -*- import os -import sys import platform import re import subprocess @@ -168,11 +167,14 @@ if platform.system() not in ['Windows']: config.available_features.add('can-remove-opened-file') -# Check 64-bit host -if sys.maxsize > 2**32: +# Features +known_arches = ["x86_64", "mips64", "ppc64", "aarch64"] +if (config.host_ldflags.find("-m32") < 0 + and any(config.host_triple.startswith(x) for x in known_arches)): config.available_features.add("clang-64-bits") + def calculate_arch_features(arch_string): features = [] for arch in arch_string.split(): diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in --- a/clang/test/lit.site.cfg.py.in +++ b/clang/test/lit.site.cfg.py.in @@ -31,6 +31,7 @@ config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@") config.has_plugins = @LLVM_ENABLE_PLUGINS@ config.clang_vendor_uti = "@CLANG_VENDOR_UTI@" +config.host_ldflags = '@HOST_LDFLAGS@' # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time.