Update bitcode reader and writer to handle multiple return values.
[oota-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 #===------------------------------------------------------------------------===#
9
10 LEVEL  = ..
11 DIRS   = 
12
13 #
14 # Make Dejagnu the default for testing
15 #
16 all:: check-local
17
18 # Include other test rules
19 include Makefile.tests
20
21 #===------------------------------------------------------------------------===#
22 # DejaGNU testing support
23 #===------------------------------------------------------------------------===#
24
25 ifdef TESTSUITE
26 CLEANED_TESTSUITE := $(patsubst %/,%,$(TESTSUITE))
27 CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE))
28 RUNTESTFLAGS := --tool $(CLEANED_TESTSUITE)
29 endif
30
31 IGNORE_TESTS :=
32
33 ifndef RUNLLVM2CPP
34 IGNORE_TESTS += llvm2cpp.exp
35 endif
36
37 IGNORE_TESTS += $(filter-out $(BINDINGS_TO_BUILD:=.exp),$(ALL_BINDINGS:=.exp))
38
39 ifdef IGNORE_TESTS
40 RUNTESTFLAGS += --ignore "$(strip $(IGNORE_TESTS))"
41 endif
42
43 ifneq ($(RUNTEST),)
44 check-local:: site.exp
45         ( ulimit -t 600 ; ulimit -d 512000 ; \
46           PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
47           $(RUNTEST) $(RUNTESTFLAGS) )
48 else
49 check-local:: site.exp
50         @echo "*** dejagnu not found.  Make sure runtest is in your PATH, then reconfigure llvm."
51 endif
52
53 ifdef TESTONE
54 CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
55 CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
56 SUBDIR := $(shell dirname $(CLEANED_TESTONE))
57 TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
58 check-one: site.exp $(TCLSH)
59         $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
60           echo "set subdir $(SUBDIR)" ; \
61           echo "proc pass  { msg } { puts \"PASS: \$$msg\" } "; \
62           echo "proc fail  { msg } { puts \"FAIL: \$$msg\" }" ; \
63           echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
64           echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
65           echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
66           echo "RunLLVMTests $(TESTPATH)" ) | \
67         ( ulimit -t 600 ; ulimit -d 512000 ; \
68           PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
69           $(TCLSH) )
70 endif
71
72 clean::
73         $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
74
75 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
76         @echo 'Making a new site.exp file...'
77         @echo '## these variables are automatically generated by make ##' >site.tmp
78         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
79         @echo '# edit the last section' >>site.tmp
80         @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
81         @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
82         @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
83         @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
84         @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
85         @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
86         @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
87         @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
88         @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
89         @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
90         @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
91         @echo 'set gccpath "$(CC)"' >>site.tmp
92         @echo 'set gxxpath "$(CXX)"' >>site.tmp
93         @echo 'set compile_c "$(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c "' >>site.tmp
94         @echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) - c"' >> site.tmp
95         @echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
96         @echo 'set llvmgcc "$(LLVMGCC)"' >> site.tmp
97         @echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
98         @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
99         @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
100         @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
101         @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
102         @test ! -f site.exp || \
103         sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
104         @-rm -f site.bak
105         @test ! -f site.exp || mv site.exp site.bak
106         @mv site.tmp site.exp