2004-11-07 05:05:37 +00:00
|
|
|
#===- test/Makefile ----------------------------------------*- Makefile -*--===#
|
2009-03-06 12:25:56 +00:00
|
|
|
#
|
2004-11-07 05:05:37 +00:00
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
2007-12-29 20:11:13 +00:00
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2009-03-06 12:25:56 +00:00
|
|
|
#
|
2004-11-07 05:05:37 +00:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2008-12-31 17:38:27 +00:00
|
|
|
LEVEL = ..
|
2009-03-06 12:25:56 +00:00
|
|
|
DIRS =
|
2002-01-23 21:36:59 +00:00
|
|
|
|
2004-12-06 05:35:38 +00:00
|
|
|
all:: check-local
|
2003-09-06 15:12:21 +00:00
|
|
|
|
2010-08-02 01:25:20 +00:00
|
|
|
# 'lit' is the default test runner.
|
2010-08-02 00:05:18 +00:00
|
|
|
check-local:: check-local-lit
|
|
|
|
|
2003-10-27 17:46:42 +00:00
|
|
|
# Include other test rules
|
|
|
|
include Makefile.tests
|
|
|
|
|
2004-11-07 05:05:37 +00:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
# DejaGNU testing support
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2009-06-26 05:44:53 +00:00
|
|
|
ifneq ($(GREP_OPTIONS),)
|
|
|
|
$(warning GREP_OPTIONS environment variable may interfere with test results)
|
|
|
|
endif
|
|
|
|
|
2008-02-26 12:08:55 +00:00
|
|
|
ifdef VERBOSE
|
2012-05-08 18:26:07 +00:00
|
|
|
RUNTESTFLAGS := $(VERBOSE)
|
2010-04-17 19:04:03 +00:00
|
|
|
LIT_ARGS := -v
|
2009-09-08 05:31:44 +00:00
|
|
|
else
|
|
|
|
LIT_ARGS := -s -v
|
2008-02-26 12:08:55 +00:00
|
|
|
endif
|
|
|
|
|
2010-10-22 09:40:37 +00:00
|
|
|
# -jN causes crash on Cygwin's python.
|
|
|
|
ifneq (,$(filter $(HOST_OS),Cygwin))
|
|
|
|
LIT_ARGS += -j1
|
|
|
|
endif
|
|
|
|
|
2004-11-07 21:39:41 +00:00
|
|
|
ifdef TESTSUITE
|
2009-09-08 05:31:44 +00:00
|
|
|
LIT_TESTSUITE := $(TESTSUITE)
|
2004-12-12 21:39:49 +00:00
|
|
|
CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
|
2006-11-11 01:02:45 +00:00
|
|
|
CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
|
2012-05-08 18:26:07 +00:00
|
|
|
RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE)
|
2009-09-08 05:31:44 +00:00
|
|
|
else
|
|
|
|
LIT_TESTSUITE := .
|
2004-11-07 21:39:41 +00:00
|
|
|
endif
|
|
|
|
|
2008-10-07 14:48:14 +00:00
|
|
|
ifdef VG
|
2009-09-14 15:27:43 +00:00
|
|
|
VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full $(VALGRIND_EXTRA_ARGS)
|
2008-10-07 14:48:14 +00:00
|
|
|
endif
|
|
|
|
|
2009-09-20 19:04:28 +00:00
|
|
|
# Check what to run for -all.
|
2009-09-20 06:17:21 +00:00
|
|
|
LIT_ALL_TESTSUITES := $(LIT_TESTSUITE)
|
2009-09-20 19:04:28 +00:00
|
|
|
|
|
|
|
extra-lit-site-cfgs::
|
|
|
|
.PHONY: extra-lit-site-cfgs
|
|
|
|
|
|
|
|
ifneq ($(strip $(filter check-local-all,$(MAKECMDGOALS))),)
|
2009-09-20 06:17:21 +00:00
|
|
|
ifndef TESTSUITE
|
2011-10-16 02:54:14 +00:00
|
|
|
ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/Makefile && echo OK), OK)
|
2009-09-20 06:17:21 +00:00
|
|
|
LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/test
|
2009-09-20 19:04:28 +00:00
|
|
|
|
|
|
|
# Force creation of Clang's lit.site.cfg.
|
|
|
|
clang-lit-site-cfg: FORCE
|
2011-02-03 07:36:02 +00:00
|
|
|
$(MAKE) -C $(PROJ_OBJ_DIR)/../tools/clang/test lit.site.cfg Unit/lit.site.cfg
|
2009-09-20 19:04:28 +00:00
|
|
|
extra-lit-site-cfgs:: clang-lit-site-cfg
|
|
|
|
endif
|
2009-09-20 06:17:21 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-09-18 12:26:17 +00:00
|
|
|
IGNORE_TESTS :=
|
|
|
|
|
2006-05-28 04:21:40 +00:00
|
|
|
ifndef RUNLLVM2CPP
|
2007-09-18 12:26:17 +00:00
|
|
|
IGNORE_TESTS += llvm2cpp.exp
|
|
|
|
endif
|
|
|
|
|
2012-05-08 18:26:07 +00:00
|
|
|
ifdef IGNORE_TESTS
|
|
|
|
RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
|
|
|
|
endif
|
|
|
|
|
2009-11-16 23:32:30 +00:00
|
|
|
# ulimits like these are redundantly enforced by the buildbots, so
|
|
|
|
# just removing them here won't work.
|
2009-08-01 03:37:54 +00:00
|
|
|
# Both AuroraUX & Solaris do not have the -m flag for ulimit
|
2009-08-18 00:40:33 +00:00
|
|
|
ifeq ($(HOST_OS),SunOS)
|
2009-11-16 23:32:30 +00:00
|
|
|
ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -v 512000 ;
|
2009-10-26 02:37:56 +00:00
|
|
|
else # !SunOS
|
|
|
|
ifeq ($(HOST_OS),AuroraUX)
|
2009-11-16 23:32:30 +00:00
|
|
|
ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -v 512000 ;
|
2009-10-26 02:37:56 +00:00
|
|
|
else # !AuroraUX
|
2010-08-05 03:35:01 +00:00
|
|
|
# Fedora 13 x86-64 python fails with -v 76800
|
|
|
|
ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -v 1024000 ;
|
2009-10-26 02:37:56 +00:00
|
|
|
endif # AuroraUX
|
|
|
|
endif # SunOS
|
2009-08-01 03:37:54 +00:00
|
|
|
|
2012-05-08 18:26:07 +00:00
|
|
|
ifneq ($(RUNTEST),)
|
|
|
|
check-local-dg:: site.exp
|
|
|
|
( $(ULIMIT) \
|
|
|
|
PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH)" \
|
|
|
|
$(RUNTEST) $(RUNTESTFLAGS) )
|
|
|
|
else
|
|
|
|
check-local-dg:: site.exp
|
|
|
|
@echo "*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM."
|
|
|
|
endif
|
|
|
|
|
2009-09-14 02:39:01 +00:00
|
|
|
check-local-lit:: lit.site.cfg Unit/lit.site.cfg
|
2009-09-08 05:31:44 +00:00
|
|
|
( $(ULIMIT) \
|
2009-11-08 09:08:00 +00:00
|
|
|
$(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
|
2009-09-08 05:31:44 +00:00
|
|
|
|
2009-09-20 19:04:28 +00:00
|
|
|
check-local-all:: lit.site.cfg Unit/lit.site.cfg extra-lit-site-cfgs
|
2009-09-20 06:17:21 +00:00
|
|
|
( $(ULIMIT) \
|
2009-11-08 09:08:00 +00:00
|
|
|
$(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) )
|
2009-09-20 06:17:21 +00:00
|
|
|
|
2004-12-04 06:25:08 +00:00
|
|
|
clean::
|
2007-01-17 07:59:14 +00:00
|
|
|
$(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
|
2004-11-07 04:59:52 +00:00
|
|
|
|
2009-02-02 21:09:36 +00:00
|
|
|
# dsymutil is used on the Darwin to manipulate DWARF debugging information.
|
2009-08-18 00:40:33 +00:00
|
|
|
ifeq ($(TARGET_OS),Darwin)
|
2009-02-02 21:09:36 +00:00
|
|
|
DSYMUTIL=dsymutil
|
|
|
|
else
|
|
|
|
DSYMUTIL=true
|
|
|
|
endif
|
|
|
|
|
2009-09-03 23:27:31 +00:00
|
|
|
ifneq ($(OCAMLOPT),)
|
|
|
|
CC_FOR_OCAMLOPT := $(shell $(OCAMLOPT) -config | grep native_c_compiler | sed -e 's/native_c_compiler: //')
|
|
|
|
CXX_FOR_OCAMLOPT := $(subst gcc,g++,$(CC_FOR_OCAMLOPT))
|
2009-07-21 21:56:46 +00:00
|
|
|
endif
|
|
|
|
|
2008-10-07 14:48:14 +00:00
|
|
|
FORCE:
|
|
|
|
|
2012-05-08 18:26:07 +00:00
|
|
|
site.exp: FORCE
|
|
|
|
@echo 'Making a new site.exp file...'
|
|
|
|
@echo '## Autogenerated by LLVM configuration.' > site.tmp
|
|
|
|
@echo '# Do not edit!' >> site.tmp
|
|
|
|
@echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
|
|
|
|
@echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
|
|
|
|
@echo 'set llvmshlibdir "$(SharedLibDir)"' >>site.tmp
|
|
|
|
@echo 'set llvm_bindings "$(BINDINGS_TO_BUILD)"' >> site.tmp
|
|
|
|
@echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
|
|
|
|
@echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
|
|
|
|
@echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
|
|
|
|
@echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
|
|
|
|
@echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
|
|
|
|
@echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
|
|
|
|
@echo 'set ocamlopt "$(OCAMLOPT) -cc \"$(CXX_FOR_OCAMLOPT)\" -I $(LibDir)/ocaml"' >> site.tmp
|
|
|
|
@echo 'set valgrind "$(VALGRIND)"' >> site.tmp
|
|
|
|
@echo 'set grep "$(GREP)"' >>site.tmp
|
|
|
|
@echo 'set gas "$(GAS)"' >>site.tmp
|
|
|
|
@echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
|
|
|
|
@test ! -f site.exp || \
|
|
|
|
sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
|
|
|
|
@-rm -f site.bak
|
|
|
|
@test ! -f site.exp || mv site.exp site.bak
|
|
|
|
@mv site.tmp site.exp
|
|
|
|
|
2011-06-22 23:23:19 +00:00
|
|
|
ifeq ($(DISABLE_ASSERTIONS),1)
|
|
|
|
ENABLE_ASSERTIONS=0
|
|
|
|
else
|
|
|
|
ENABLE_ASSERTIONS=1
|
|
|
|
endif
|
|
|
|
|
2012-05-08 18:26:07 +00:00
|
|
|
lit.site.cfg: site.exp
|
2009-09-20 19:04:28 +00:00
|
|
|
@echo "Making LLVM 'lit.site.cfg' file..."
|
2011-03-08 12:25:10 +00:00
|
|
|
@$(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=@LLVMGCCDIR@=$(LLVMGCCDIR)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=python=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
|
2011-06-23 17:52:36 +00:00
|
|
|
@$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
|
2012-02-16 06:28:33 +00:00
|
|
|
@$(ECHOPATH) s=@TARGETS_TO_BUILD@=$(TARGETS_TO_BUILD)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINDINGS@=$(BINDINGS_TO_BUILD)=g >> lit.tmp
|
2012-05-17 21:07:47 +00:00
|
|
|
@$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
|
2011-03-08 12:25:10 +00:00
|
|
|
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
|
|
|
@-rm -f lit.tmp
|
2009-09-14 02:39:01 +00:00
|
|
|
|
2009-10-02 09:30:03 +00:00
|
|
|
Unit/lit.site.cfg: $(PROJ_OBJ_DIR)/Unit/.dir FORCE
|
2009-09-20 19:04:28 +00:00
|
|
|
@echo "Making LLVM unittest 'lit.site.cfg' file..."
|
2011-03-08 12:25:10 +00:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVMGCCDIR@=$(LLVMGCCDIR)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
|
2012-05-17 21:07:47 +00:00
|
|
|
@$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
|
2011-03-08 12:25:10 +00:00
|
|
|
@sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
|
|
|
|
@-rm -f unit.tmp
|