Constify getter methods.
[llvm/msp430.git] / test / Makefile
blob8ba4f33541174a142ba6a1d0848f20ad2745c175
1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 LEVEL = ..
11 DIRS =
14 # Make Dejagnu the default for testing
16 all:: check-local
18 # Include other test rules
19 include Makefile.tests
21 #===------------------------------------------------------------------------===#
22 # DejaGNU testing support
23 #===------------------------------------------------------------------------===#
25 ifdef VERBOSE
26 RUNTESTFLAGS := $(VERBOSE)
27 endif
29 ifdef TESTSUITE
30 CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
31 CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
32 RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE)
33 endif
35 ifdef VG
36 VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full
37 endif
39 IGNORE_TESTS :=
41 ifndef RUNLLVM2CPP
42 IGNORE_TESTS += llvm2cpp.exp
43 endif
45 IGNORE_TESTS += $(filter-out $(BINDINGS_TO_BUILD:=.exp),$(ALL_BINDINGS:=.exp))
47 ifdef IGNORE_TESTS
48 RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
49 endif
51 ifneq ($(RUNTEST),)
52 check-local:: site.exp
53 ( ulimit -t 600 ; ulimit -d 512000 ; \
54 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
55 $(RUNTEST) $(RUNTESTFLAGS) )
56 else
57 check-local:: site.exp
58 @echo "*** dejagnu not found. Make sure 'runtest' is in your PATH, then reconfigure LLVM."
59 endif
61 ifdef TESTONE
62 CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
63 CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
64 SUBDIR := $(shell dirname $(CLEANED_TESTONE))
65 TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
66 check-one: site.exp $(TCLSH)
67 $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
68 echo "set subdir $(SUBDIR)" ; \
69 echo "proc pass { msg } { puts \"PASS: \$$msg\" } "; \
70 echo "proc fail { msg } { puts \"FAIL: \$$msg\" }" ; \
71 echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
72 echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
73 echo "proc verbose args { }" ; \
74 echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
75 echo "RunLLVMTests $(TESTPATH)" ) | \
76 ( ulimit -t 600 ; ulimit -d 512000 ; \
77 PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
78 $(TCLSH) )
79 endif
81 clean::
82 $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
84 # dsymutil is used on the Darwin to manipulate DWARF debugging information.
85 ifeq ($(OS),Darwin)
86 DSYMUTIL=dsymutil
87 else
88 DSYMUTIL=true
89 endif
90 ifdef TargetCommonOpts
91 BUGPOINT_TOPTS="-gcc-tool-args $(TargetCommonOpts)"
92 else
93 BUGPOINT_TOPTS=""
94 endif
96 FORCE:
98 site.exp: FORCE
99 @echo 'Making a new site.exp file...'
100 @echo '## these variables are automatically generated by make ##' >site.tmp
101 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
102 @echo '# edit the last section' >>site.tmp
103 @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
104 @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
105 @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
106 @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
107 @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
108 @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
109 @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
110 @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
111 @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
112 @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
113 @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
114 @echo 'set gccpath "$(CC)"' >>site.tmp
115 @echo 'set gxxpath "$(CXX)"' >>site.tmp
116 @echo 'set compile_c "' $(CC) $(CPP.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >>site.tmp
117 @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >> site.tmp
118 @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
119 @echo 'set llvmgcc "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
120 @echo 'set llvmgxx "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
121 @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
122 @echo 'set bugpoint_topts $(BUGPOINT_TOPTS)' >> site.tmp
123 @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
124 @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
125 @echo 'set valgrind "$(VALGRIND)"' >> site.tmp
126 @echo 'set grep "$(GREP)"' >>site.tmp
127 @echo 'set gas "$(GAS)"' >>site.tmp
128 @echo 'set llvmdsymutil "$(DSYMUTIL)"' >>site.tmp
129 @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
130 @test ! -f site.exp || \
131 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
132 @-rm -f site.bak
133 @test ! -f site.exp || mv site.exp site.bak
134 @mv site.tmp site.exp