2004-11-07 06:05:37 +01:00
|
|
|
#===- test/Makefile ----------------------------------------*- Makefile -*--===#
|
2009-03-06 13:25:56 +01:00
|
|
|
#
|
2004-11-07 06:05:37 +01:00
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
2007-12-29 21:11:13 +01:00
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2009-03-06 13:25:56 +01:00
|
|
|
#
|
2004-11-07 06:05:37 +01:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2008-12-31 18:38:27 +01:00
|
|
|
LEVEL = ..
|
2009-03-06 13:25:56 +01:00
|
|
|
DIRS =
|
2002-01-23 22:36:59 +01:00
|
|
|
|
2004-12-06 06:35:38 +01:00
|
|
|
all:: check-local
|
2003-09-06 17:12:21 +02:00
|
|
|
|
2003-10-27 18:46:42 +01:00
|
|
|
# Include other test rules
|
|
|
|
include Makefile.tests
|
|
|
|
|
2004-11-07 06:05:37 +01:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
# DejaGNU testing support
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
2009-06-26 07:44:53 +02:00
|
|
|
ifneq ($(GREP_OPTIONS),)
|
|
|
|
$(warning GREP_OPTIONS environment variable may interfere with test results)
|
|
|
|
endif
|
|
|
|
|
2008-02-26 13:08:55 +01:00
|
|
|
ifdef VERBOSE
|
2010-04-17 21:04:03 +02:00
|
|
|
LIT_ARGS := -v
|
2009-09-08 07:31:44 +02:00
|
|
|
else
|
|
|
|
LIT_ARGS := -s -v
|
2008-02-26 13:08:55 +01:00
|
|
|
endif
|
|
|
|
|
2004-11-07 22:39:41 +01:00
|
|
|
ifdef TESTSUITE
|
2009-09-08 07:31:44 +02:00
|
|
|
LIT_TESTSUITE := $(TESTSUITE)
|
|
|
|
else
|
|
|
|
LIT_TESTSUITE := .
|
2004-11-07 22:39:41 +01:00
|
|
|
endif
|
|
|
|
|
2009-09-20 21:04:28 +02:00
|
|
|
# Check what to run for -all.
|
2009-09-20 08:17:21 +02:00
|
|
|
LIT_ALL_TESTSUITES := $(LIT_TESTSUITE)
|
2009-09-20 21:04:28 +02:00
|
|
|
|
2012-06-28 02:03:15 +02:00
|
|
|
extra-site-cfgs::
|
|
|
|
.PHONY: extra-site-cfgs
|
2009-09-20 21:04:28 +02:00
|
|
|
|
|
|
|
ifneq ($(strip $(filter check-local-all,$(MAKECMDGOALS))),)
|
2009-09-20 08:17:21 +02:00
|
|
|
ifndef TESTSUITE
|
2011-10-16 04:54:14 +02:00
|
|
|
ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/Makefile && echo OK), OK)
|
2009-09-20 08:17:21 +02:00
|
|
|
LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/test
|
2009-09-20 21:04:28 +02:00
|
|
|
|
|
|
|
# Force creation of Clang's lit.site.cfg.
|
2012-06-28 02:03:15 +02:00
|
|
|
clang-site-cfg: FORCE
|
2011-02-03 08:36:02 +01:00
|
|
|
$(MAKE) -C $(PROJ_OBJ_DIR)/../tools/clang/test lit.site.cfg Unit/lit.site.cfg
|
2012-06-28 02:03:15 +02:00
|
|
|
extra-site-cfgs:: clang-site-cfg
|
2009-09-20 21:04:28 +02:00
|
|
|
endif
|
2012-08-09 22:26:41 +02:00
|
|
|
|
|
|
|
ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/Makefile && echo OK), OK)
|
|
|
|
LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/test
|
2013-03-22 19:54:14 +01:00
|
|
|
|
|
|
|
# Force creation of Clang Tools' lit.site.cfg.
|
|
|
|
clang-tools-site-cfg: FORCE
|
2014-08-13 22:41:26 +02:00
|
|
|
$(MAKE) -C $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/test lit.site.cfg Unit/lit.site.cfg
|
2013-03-22 19:54:14 +01:00
|
|
|
extra-site-cfgs:: clang-tools-site-cfg
|
2012-08-09 22:26:41 +02:00
|
|
|
endif
|
2013-05-20 20:49:15 +02:00
|
|
|
|
2014-06-06 11:06:25 +02:00
|
|
|
ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/lld/Makefile && echo OK), OK)
|
|
|
|
LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/lld/test
|
|
|
|
|
|
|
|
# Force creation of lld's lit.site.cfg.
|
|
|
|
lld-site-cfg: FORCE
|
|
|
|
$(MAKE) -C $(PROJ_OBJ_DIR)/../tools/lld/test lit.site.cfg Unit/lit.site.cfg
|
|
|
|
extra-site-cfgs:: lld-site-cfg
|
|
|
|
endif
|
|
|
|
|
2013-05-20 20:49:15 +02:00
|
|
|
ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/polly/Makefile && echo OK), OK)
|
|
|
|
LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/polly/test
|
|
|
|
|
|
|
|
# Force creation of Polly's lit.site.cfg.
|
|
|
|
polly-tools-site-cfg: FORCE
|
|
|
|
$(MAKE) -C $(PROJ_OBJ_DIR)/../tools/polly/test lit.site.cfg
|
|
|
|
extra-site-cfgs:: polly-tools-site-cfg
|
|
|
|
endif
|
2009-09-20 08:17:21 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-11-17 00:32:30 +01:00
|
|
|
# ulimits like these are redundantly enforced by the buildbots, so
|
|
|
|
# just removing them here won't work.
|
2014-08-14 17:15:09 +02:00
|
|
|
# Solaris does not have the -m flag for ulimit
|
2009-08-18 02:40:33 +02:00
|
|
|
ifeq ($(HOST_OS),SunOS)
|
2015-02-13 20:45:19 +01:00
|
|
|
ULIMIT=ulimit -t 1200 ; ulimit -d 512000 ; ulimit -v 512000 ;
|
2009-10-26 03:37:56 +01:00
|
|
|
else # !SunOS
|
2012-12-09 11:34:22 +01:00
|
|
|
# Newer versions of python try to allocate an insane amount of address space for
|
|
|
|
# its thread-local storage, don't set a limit here.
|
2013-03-12 13:38:10 +01:00
|
|
|
# When -v is not used, then -s has to be used to limit the stack size.
|
2012-12-09 11:34:22 +01:00
|
|
|
# FIXME: Those limits should be enforced by lit instead of globally.
|
2015-02-13 20:45:19 +01:00
|
|
|
ULIMIT=ulimit -t 1200 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -s 8192 ;
|
2009-10-26 03:37:56 +01:00
|
|
|
endif # SunOS
|
2009-08-01 05:37:54 +02:00
|
|
|
|
2012-06-28 02:03:15 +02:00
|
|
|
check-local:: lit.site.cfg Unit/lit.site.cfg
|
2009-09-08 07:31:44 +02:00
|
|
|
( $(ULIMIT) \
|
2013-01-30 05:07:37 +01:00
|
|
|
$(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
|
2009-09-08 07:31:44 +02:00
|
|
|
|
2012-06-28 02:03:15 +02:00
|
|
|
# This is a legacy alias dating from when both DejaGNU and lit were in use.
|
|
|
|
check-local-lit:: check-local
|
|
|
|
|
|
|
|
check-local-all:: lit.site.cfg Unit/lit.site.cfg extra-site-cfgs
|
2009-09-20 08:17:21 +02:00
|
|
|
( $(ULIMIT) \
|
2013-01-30 05:07:37 +01:00
|
|
|
$(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) )
|
2009-09-20 08:17:21 +02:00
|
|
|
|
2004-12-04 07:25:08 +01:00
|
|
|
clean::
|
2007-01-17 08:59:14 +01:00
|
|
|
$(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
|
2004-11-07 05:59:52 +01:00
|
|
|
|
2008-10-07 16:48:14 +02:00
|
|
|
FORCE:
|
|
|
|
|
2011-06-23 01:23:19 +02:00
|
|
|
ifeq ($(DISABLE_ASSERTIONS),1)
|
|
|
|
ENABLE_ASSERTIONS=0
|
|
|
|
else
|
|
|
|
ENABLE_ASSERTIONS=1
|
|
|
|
endif
|
|
|
|
|
2012-06-28 02:16:51 +02:00
|
|
|
lit.site.cfg: FORCE
|
2009-09-20 21:04:28 +02:00
|
|
|
@echo "Making LLVM 'lit.site.cfg' file..."
|
2013-05-04 09:36:23 +02:00
|
|
|
@$(ECHOPATH) s=@LLVM_HOST_TRIPLE@=$(HOST_TRIPLE)=g > lit.tmp
|
Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time. This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.
Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it. On architectures with a
single bitness, the host and process triples are identical. On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.
This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.
Differential Revision: http://llvm-reviews.chandlerc.com/D254
llvm-svn: 172627
2013-01-16 18:27:22 +01:00
|
|
|
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
|
2012-06-28 02:16:51 +02:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
|
2011-03-08 13:25:10 +01:00
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
|
2014-12-30 04:24:11 +01:00
|
|
|
@$(ECHOPATH) s=@LLVM_LIBRARY_DIR@=$(LibDir)=g >> lit.tmp
|
2012-06-28 02:16:51 +02:00
|
|
|
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
|
2014-01-22 22:52:35 +01:00
|
|
|
@$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
|
2013-01-30 05:07:37 +01:00
|
|
|
@$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
|
2015-02-14 10:43:57 +01:00
|
|
|
@$(ECHOPATH) s=@GOLD_EXECUTABLE@=ld=g >> lit.tmp
|
2015-03-20 00:55:38 +01:00
|
|
|
@$(ECHOPATH) s=@LD64_EXECUTABLE@=ld=g >> lit.tmp
|
2014-10-30 09:29:45 +01:00
|
|
|
@$(ECHOPATH) s=@OCAMLFIND@=$(OCAMLFIND)=g >> lit.tmp
|
2014-11-13 10:29:30 +01:00
|
|
|
@$(ECHOPATH) s!@OCAMLFLAGS@!$(addprefix -cclib ,$(LDFLAGS))!g >> lit.tmp
|
2014-10-30 09:29:45 +01:00
|
|
|
@$(ECHOPATH) s=@HAVE_OCAMLOPT@=$(HAVE_OCAMLOPT)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@HAVE_OCAML_OUNIT@=$(HAVE_OCAML_OUNIT)=g >> lit.tmp
|
2014-10-17 00:48:02 +02:00
|
|
|
@$(ECHOPATH) s=@GO_EXECUTABLE@=$(GO)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s!@HOST_CC@!$(CC)!g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s!@HOST_CXX@!$(CXX)!g >> lit.tmp
|
2014-10-21 02:36:28 +02:00
|
|
|
@$(ECHOPATH) s!@HOST_LDFLAGS@!$(LDFLAGS)!g >> lit.tmp
|
2011-03-08 13:25:10 +01:00
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
|
2011-06-23 19:52:36 +02:00
|
|
|
@$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
|
2012-02-16 07:28:33 +01: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 23:07:47 +02:00
|
|
|
@$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
|
2013-04-23 12:17:34 +02:00
|
|
|
@$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp
|
2015-02-22 08:01:41 +01:00
|
|
|
@$(ECHOPATH) s=@HAVE_DIA_SDK@=0=g >> lit.tmp
|
2011-03-08 13:25:10 +01:00
|
|
|
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
|
|
|
@-rm -f lit.tmp
|
2009-09-14 04:39:01 +02:00
|
|
|
|
2009-10-02 11:30:03 +02:00
|
|
|
Unit/lit.site.cfg: $(PROJ_OBJ_DIR)/Unit/.dir FORCE
|
2009-09-20 21:04:28 +02:00
|
|
|
@echo "Making LLVM unittest 'lit.site.cfg' file..."
|
2011-03-08 13:25:10 +01: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=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
|
2012-05-17 23:07:47 +02:00
|
|
|
@$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
|
2011-03-08 13:25:10 +01:00
|
|
|
@sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
|
|
|
|
@-rm -f unit.tmp
|