[llvm-commits] [llvm] r133664 - in /llvm/trunk: cmake/modules/HandleLLVMOptions.cmake test/CodeGen/X86/2011-06-14-PreschedRegalias.ll test/Makefile test/lit.cfg test/lit.site.cfg.in utils/lit/lit/TestRunner.py utils/lit/lit/TestingConfig.py

Justin Holewinski justin.holewinski at gmail.com
Thu Jun 23 09:09:30 PDT 2011


This seems to be breaking the regression tests for me on OS X, with Python 2.7 and CMake 2.8.4.  Specifically, the line:

config.enable_assertions = @LLVM_ENABLE_ASSERTIONS@

For me, this is being configured as:

config.enable_assertions = ON

which is invalid Python (symbol 'ON' does not exist).  Manually changing this to:

config.enable_assertions = 1

fixes the issue.


Seems to be a CMake naming issue (using ON instead of 1)

On Jun 22, 2011, at 7:23 PM, Andrew Trick wrote:

> Author: atrick
> Date: Wed Jun 22 18:23:19 2011
> New Revision: 133664
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=133664&view=rev
> Log:
> lit support for REQUIRES: asserts.
> 
> Take #2. Don't piggyback on the existing config.build_mode. Instead,
> define a new lit feature for each build feature we need (currently
> just "asserts"). Teach both autoconf'd and cmake'd Makefiles to define
> this feature within test/lit.site.cfg. This doesn't require any lit
> harness changes and should be more robust across build systems.
> 
> Modified:
>    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
>    llvm/trunk/test/CodeGen/X86/2011-06-14-PreschedRegalias.ll
>    llvm/trunk/test/Makefile
>    llvm/trunk/test/lit.cfg
>    llvm/trunk/test/lit.site.cfg.in
>    llvm/trunk/utils/lit/lit/TestRunner.py
>    llvm/trunk/utils/lit/lit/TestingConfig.py
> 
> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed Jun 22 18:23:19 2011
> @@ -36,13 +36,8 @@
>   # explicitly undefine it:
>   if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
>     add_definitions( -UNDEBUG )
> -    set(LLVM_BUILD_MODE "Release")
> -  else()
> -    set(LLVM_BUILD_MODE "Debug")
>   endif()
> -  set(LLVM_BUILD_MODE "${LLVM_BUILD_MODE}+Asserts")
> else()
> -  set(LLVM_BUILD_MODE "Release")
>   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
>     if( NOT MSVC_IDE AND NOT XCODE )
>       add_definitions( -DNDEBUG )
> 
> Modified: llvm/trunk/test/CodeGen/X86/2011-06-14-PreschedRegalias.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2011-06-14-PreschedRegalias.ll?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/test/CodeGen/X86/2011-06-14-PreschedRegalias.ll (original)
> +++ llvm/trunk/test/CodeGen/X86/2011-06-14-PreschedRegalias.ll Wed Jun 22 18:23:19 2011
> @@ -1,5 +1,5 @@
> ; RUN: llc < %s -march=x86-64 -stress-sched | FileCheck %s
> -; REQUIRES: Asserts
> +; REQUIRES: asserts
> ; Test interference between physreg aliases during preRAsched.
> ; mul wants an operand in AL, but call clobbers it.
> 
> 
> Modified: llvm/trunk/test/Makefile
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/test/Makefile (original)
> +++ llvm/trunk/test/Makefile Wed Jun 22 18:23:19 2011
> @@ -171,15 +171,21 @@
> 	@test ! -f site.exp || mv site.exp site.bak
> 	@mv site.tmp site.exp
> 
> +ifeq ($(DISABLE_ASSERTIONS),1)
> +ENABLE_ASSERTIONS=0
> +else
> +ENABLE_ASSERTIONS=1
> +endif
> +
> lit.site.cfg: site.exp
> 	@echo "Making LLVM 'lit.site.cfg' file..."
> 	@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
> 	@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
> 	@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
> -	@$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> lit.tmp
> 	@$(ECHOPATH) s=@LLVMGCCDIR@=$(LLVMGCCDIR)=g >> lit.tmp
> 	@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=python=g >> lit.tmp
> 	@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
> +	@$(ECHOPATH) s=@LLVM_ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
> 	@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
> 	@-rm -f lit.tmp
> 
> 
> Modified: llvm/trunk/test/lit.cfg
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/test/lit.cfg (original)
> +++ llvm/trunk/test/lit.cfg Wed Jun 22 18:23:19 2011
> @@ -306,3 +306,6 @@
> 
> if loadable_module:
>     config.available_features.add('loadable_module')
> +
> +if config.enable_assertions:
> +    config.available_features.add('asserts')
> 
> Modified: llvm/trunk/test/lit.site.cfg.in
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.in?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/test/lit.site.cfg.in (original)
> +++ llvm/trunk/test/lit.site.cfg.in Wed Jun 22 18:23:19 2011
> @@ -5,9 +5,9 @@
> config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
> config.llvmgcc_dir = "@LLVMGCCDIR@"
> config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
> -config.llvm_build_modes = "@LLVM_BUILD_MODE@".split('+')
> config.python_executable = "@PYTHON_EXECUTABLE@"
> config.enable_shared = @ENABLE_SHARED@
> +config.enable_assertions = @LLVM_ENABLE_ASSERTIONS@
> 
> # Support substitution of the tools_dir with user parameters. This is
> # used when we can't determine the tool dir at configuration time.
> 
> Modified: llvm/trunk/utils/lit/lit/TestRunner.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/TestRunner.py (original)
> +++ llvm/trunk/utils/lit/lit/TestRunner.py Wed Jun 22 18:23:19 2011
> @@ -473,11 +473,9 @@
>     if script[-1][-1] == '\\':
>         return (Test.UNRESOLVED, "Test has unterminated run lines (with '\\')")
> 
> -    # Check that we have the required features or build modes:
> +    # Check that we have the required features:
>     missing_required_features = [f for f in requires
> -                                 if f not in test.config.available_features
> -                                 and f not in test.config.llvm_build_modes]
> -
> +                                 if f not in test.config.available_features]
>     if missing_required_features:
>         msg = ', '.join(missing_required_features)
>         return (Test.UNSUPPORTED,
> 
> Modified: llvm/trunk/utils/lit/lit/TestingConfig.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestingConfig.py?rev=133664&r1=133663&r2=133664&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/TestingConfig.py (original)
> +++ llvm/trunk/utils/lit/lit/TestingConfig.py Wed Jun 22 18:23:19 2011
> @@ -74,7 +74,6 @@
> 
>     def clone(self, path):
>         # FIXME: Chain implementations?
> -        # See attribute chaining in finish()
>         #
>         # FIXME: Allow extra parameters?
>         cfg = TestingConfig(self, self.name, self.suffixes, self.test_format,
> @@ -102,9 +101,3 @@
>             # files. Should we distinguish them?
>             self.test_source_root = str(self.test_source_root)
>         self.excludes = set(self.excludes)
> -
> -        # chain attributes by copying them
> -        if self.parent:
> -            for k,v in vars(self.parent).items():
> -                if not hasattr(self, k):
> -                    setattr(self, k, v)
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Thanks,

Justin Holewinski

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110623/e462208a/attachment.html>


More information about the llvm-commits mailing list