]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/blob - test/Makefile
[XCore] Support functions returning more than 4 words.
[opencl/llvm.git] / test / Makefile
1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
2 #
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
7 #
8 #===------------------------------------------------------------------------===#
10 LEVEL = ..
11 DIRS  =
13 all:: check-local
15 # Include other test rules
16 include Makefile.tests
18 #===------------------------------------------------------------------------===#
19 # DejaGNU testing support
20 #===------------------------------------------------------------------------===#
22 ifneq ($(GREP_OPTIONS),)
23 $(warning GREP_OPTIONS environment variable may interfere with test results)
24 endif
26 ifdef VERBOSE
27 LIT_ARGS := -v
28 else
29 LIT_ARGS := -s -v
30 endif
32 ifdef TESTSUITE
33 LIT_TESTSUITE := $(TESTSUITE)
34 else
35 LIT_TESTSUITE := .
36 endif
38 # Check what to run for -all.
39 LIT_ALL_TESTSUITES := $(LIT_TESTSUITE)
41 extra-site-cfgs::
42 .PHONY: extra-site-cfgs
44 ifneq ($(strip $(filter check-local-all,$(MAKECMDGOALS))),)
45 ifndef TESTSUITE
46 ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/Makefile && echo OK), OK)
47 LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/test
49 # Force creation of Clang's lit.site.cfg.
50 clang-site-cfg: FORCE
51         $(MAKE) -C $(PROJ_OBJ_DIR)/../tools/clang/test lit.site.cfg Unit/lit.site.cfg
52 extra-site-cfgs:: clang-site-cfg
53 endif
55 ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/Makefile && echo OK), OK)
56 LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/test
58 # Force creation of Clang Tools' lit.site.cfg.
59 clang-tools-site-cfg: FORCE
60         $(MAKE) -C $(PROJ_OBJ_DIR)/../tools/clang/tools/extra/test lit.site.cfg
61 extra-site-cfgs:: clang-tools-site-cfg
62 endif
64 ifeq ($(shell test -f $(PROJ_OBJ_DIR)/../tools/polly/Makefile && echo OK), OK)
65 LIT_ALL_TESTSUITES += $(PROJ_OBJ_DIR)/../tools/polly/test
67 # Force creation of Polly's lit.site.cfg.
68 polly-tools-site-cfg: FORCE
69         $(MAKE) -C $(PROJ_OBJ_DIR)/../tools/polly/test lit.site.cfg
70 extra-site-cfgs:: polly-tools-site-cfg
71 endif
72 endif
73 endif
75 # ulimits like these are redundantly enforced by the buildbots, so
76 # just removing them here won't work.
77 # Both AuroraUX & Solaris do not have the -m flag for ulimit
78 ifeq ($(HOST_OS),SunOS)
79 ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -v 512000 ;
80 else # !SunOS
81 ifeq ($(HOST_OS),AuroraUX)
82 ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -v 512000 ;
83 else # !AuroraUX
84 # Newer versions of python try to allocate an insane amount of address space for
85 # its thread-local storage, don't set a limit here.
86 # When -v is not used, then -s has to be used to limit the stack size.
87 # FIXME: Those limits should be enforced by lit instead of globally.
88 ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -s 8192 ;
89 endif # AuroraUX
90 endif # SunOS
92 check-local:: lit.site.cfg Unit/lit.site.cfg
93         ( $(ULIMIT) \
94           $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) )
96 # This is a legacy alias dating from when both DejaGNU and lit were in use.
97 check-local-lit:: check-local
99 check-local-all:: lit.site.cfg Unit/lit.site.cfg extra-site-cfgs
100         ( $(ULIMIT) \
101           $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) )
103 clean::
104         $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
106 ifneq ($(OCAMLOPT),)
107 CC_FOR_OCAMLOPT := $(shell $(OCAMLOPT) -config | grep native_c_compiler | sed -e 's/native_c_compiler: //')
108 CXX_FOR_OCAMLOPT := $(subst gcc,g++,$(CC_FOR_OCAMLOPT))
109 endif
111 FORCE:
113 ifeq ($(DISABLE_ASSERTIONS),1)
114 ENABLE_ASSERTIONS=0
115 else
116 ENABLE_ASSERTIONS=1
117 endif
119 lit.site.cfg: FORCE
120         @echo "Making LLVM 'lit.site.cfg' file..."
121         @$(ECHOPATH) s=@LLVM_HOST_TRIPLE@=$(HOST_TRIPLE)=g > lit.tmp
122         @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
123         @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g >> lit.tmp
124         @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
125         @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
126         @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
127         @$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
128         @$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
129         @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
130         @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT) -cc $(subst *,'\\\"',*$(subst =,"\\=",$(CXX_FOR_OCAMLOPT))*) -cclib -L$(LibDir) -I $(LibDir)/ocaml=g >> lit.tmp
131         @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
132         @$(ECHOPATH) s=@ENABLE_ASSERTIONS@=$(ENABLE_ASSERTIONS)=g >> lit.tmp
133         @$(ECHOPATH) s=@TARGETS_TO_BUILD@=$(TARGETS_TO_BUILD)=g >> lit.tmp
134         @$(ECHOPATH) s=@LLVM_BINDINGS@=$(BINDINGS_TO_BUILD)=g >> lit.tmp
135         @$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> lit.tmp
136         @$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
137         @$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp
138         @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
139         @-rm -f lit.tmp
141 Unit/lit.site.cfg: $(PROJ_OBJ_DIR)/Unit/.dir FORCE
142         @echo "Making LLVM unittest 'lit.site.cfg' file..."
143         @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
144         @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
145         @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
146         @$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
147         @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
148         @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
149         @$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
150         @$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> unit.tmp
151         @$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp
152         @sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
153         @-rm -f unit.tmp