Improve lit "native" feature to check if the native backend is builtin
authorMehdi Amini <mehdi.amini@apple.com>
Tue, 4 Aug 2015 06:32:31 +0000 (06:32 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Tue, 4 Aug 2015 06:32:31 +0000 (06:32 +0000)
The goal is to have 'ninja check' passing even if the X86 backend is
not built.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243958 91177308-0d34-0410-b5e6-96231b3b80d8

test/lit.cfg
test/lit.site.cfg.in

index 6d3c41256422afa4e2fa078981b11245506c7538..627c8a198017608f8f7f14291796f3855672b4a3 100644 (file)
@@ -333,10 +333,11 @@ if config.have_zlib == "1":
 else:
     config.available_features.add("nozlib")
 
 else:
     config.available_features.add("nozlib")
 
-# Native compilation: host arch == target arch
+# Native compilation: host arch == target arch and native backend built-in
 # FIXME: Consider cases that target can be executed
 # even if host_triple were different from target_triple.
 # FIXME: Consider cases that target can be executed
 # even if host_triple were different from target_triple.
-if config.host_triple == config.target_triple:
+if (config.host_triple == config.target_triple and
+    config.native_target in config.targets_to_build):
     config.available_features.add("native")
 
 import subprocess
     config.available_features.add("native")
 
 import subprocess
index 0f5d223a3abfa4e7da700608999c5e4030da2f71..0b8ca65a18e702f8cc34e79da269a2c202a13502 100644 (file)
@@ -23,6 +23,7 @@ config.go_executable = "@GO_EXECUTABLE@"
 config.enable_shared = @ENABLE_SHARED@
 config.enable_assertions = @ENABLE_ASSERTIONS@
 config.targets_to_build = "@TARGETS_TO_BUILD@"
 config.enable_shared = @ENABLE_SHARED@
 config.enable_assertions = @ENABLE_ASSERTIONS@
 config.targets_to_build = "@TARGETS_TO_BUILD@"
+config.native_target = "@LLVM_NATIVE_ARCH@"
 config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
 config.host_os = "@HOST_OS@"
 config.host_arch = "@HOST_ARCH@"
 config.llvm_bindings = "@LLVM_BINDINGS@".split(' ')
 config.host_os = "@HOST_OS@"
 config.host_arch = "@HOST_ARCH@"