[llvm-commits] [llvm] r166225 - in /llvm/trunk/test: Makefile lit.cfg lit.site.cfg.in
Daniel Dunbar
daniel at zuster.org
Thu Oct 18 13:43:11 PDT 2012
Author: ddunbar
Date: Thu Oct 18 15:43:11 2012
New Revision: 166225
URL: http://llvm.org/viewvc/llvm-project?rev=166225&view=rev
Log:
test: Add a lit config variable to check if LTO is enabled.
Modified:
llvm/trunk/test/Makefile
llvm/trunk/test/lit.cfg
llvm/trunk/test/lit.site.cfg.in
Modified: llvm/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=166225&r1=166224&r2=166225&view=diff
==============================================================================
--- llvm/trunk/test/Makefile (original)
+++ llvm/trunk/test/Makefile Thu Oct 18 15:43:11 2012
@@ -117,6 +117,16 @@
ENABLE_ASSERTIONS=1
endif
+# Derive whether or not LTO is enabled by checking the extra options.
+LTO_IS_ENABLED := 0
+ifneq ($(findstring -flto,$(CompileCommonOpts)),)
+LTO_IS_ENABLED := 1
+else
+ifneq ($(findstring -O4,$(CompileCommonOpts)),)
+LTO_IS_ENABLED := 1
+endif
+endif
+
lit.site.cfg: FORCE
@echo "Making LLVM 'lit.site.cfg' file..."
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g > lit.tmp
@@ -129,6 +139,7 @@
@$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT) -cc $(subst *,'\\\"',*$(subst =,"\\=",$(CXX_FOR_OCAMLOPT))*) -I $(LibDir)/ocaml=g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
@$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
+ @$(ECHOPATH) s=@LTO_IS_ENABLED@=$(LTO_IS_ENABLED)=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
Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=166225&r1=166224&r2=166225&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Thu Oct 18 15:43:11 2012
@@ -245,6 +245,10 @@
if loadable_module:
config.available_features.add('loadable_module')
+# LTO
+if config.lto_is_enabled == "1":
+ config.available_features.add('lto')
+
# llc knows whether he is compiled with -DNDEBUG.
import subprocess
try:
Modified: llvm/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.in?rev=166225&r1=166224&r2=166225&view=diff
==============================================================================
--- llvm/trunk/test/lit.site.cfg.in (original)
+++ llvm/trunk/test/lit.site.cfg.in Thu Oct 18 15:43:11 2012
@@ -11,6 +11,7 @@
config.ocamlopt_executable = "@OCAMLOPT@"
config.enable_shared = @ENABLE_SHARED@
config.enable_assertions = @ENABLE_ASSERTIONS@
+config.lto_is_enabled = "@LTO_IS_ENABLED@"
config.targets_to_build = "@TARGETS_TO_BUILD@"
config.llvm_bindings = "@LLVM_BINDINGS@"
config.host_os = "@HOST_OS@"
More information about the llvm-commits
mailing list