Added some if-conversion tests.
[oota-llvm.git] / test / Makefile
1 #===- test/Makefile ----------------------------------------*- Makefile -*--===#
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source 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 ifndef RUNLLVM2CPP
32 RUNTESTFLAGS += --ignore llvm2cpp.exp
33 endif
34
35 ifneq ($(RUNTEST),)
36 check-local:: site.exp
37         ( ulimit -t 600 ; ulimit -d 512000 ; \
38           PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
39           $(RUNTEST) $(RUNTESTFLAGS) )
40 else
41 check-local:: site.exp
42         @echo "*** dejagnu not found.  Make sure runtest is in your PATH, then reconfigure llvm."
43 endif
44
45 ifdef TESTONE
46 CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE))
47 CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE))
48 SUBDIR := $(shell dirname $(CLEANED_TESTONE))
49 TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE)
50 check-one: site.exp $(TCLSH)
51         $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \
52           echo "set subdir $(SUBDIR)" ; \
53           echo "proc pass  { msg } { puts \"PASS: \$$msg\" } "; \
54           echo "proc fail  { msg } { puts \"FAIL: \$$msg\" }" ; \
55           echo "proc xfail { msg } { puts \"XFAIL: \$$msg\" }" ; \
56           echo "proc xpass { msg } { puts \"XPASS: \$$msg\" }" ; \
57           echo "source $(LLVM_SRC_ROOT)/test/lib/llvm.exp" ; \
58           echo "RunLLVMTests $(TESTPATH)" ) | \
59         ( ulimit -t 600 ; ulimit -d 512000 ; \
60           PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \
61           $(TCLSH) )
62 endif
63
64 clean::
65         $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print`
66
67 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
68         @echo 'Making a new site.exp file...'
69         @echo '## these variables are automatically generated by make ##' >site.tmp
70         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
71         @echo '# edit the last section' >>site.tmp
72         @echo 'set target_triplet "$(TARGET_TRIPLE)"' >> site.tmp
73         @echo 'set TARGETS_TO_BUILD "$(TARGETS_TO_BUILD)"' >> site.tmp
74         @echo 'set llvmgcc_langs "$(LLVMGCC_LANGS)"' >> site.tmp
75         @echo 'set llvmgcc_version "$(LLVMGCC_VERSION)"' >> site.tmp
76         @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp
77         @echo 'set llvmtoolsdir "$(ToolDir)"' >>site.tmp
78         @echo 'set llvmlibsdir "$(LibDir)"' >>site.tmp
79         @echo 'set srcroot "$(LLVM_SRC_ROOT)"' >>site.tmp
80         @echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
81         @echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
82         @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
83         @echo 'set gccpath "$(CC)"' >>site.tmp
84         @echo 'set gxxpath "$(CXX)"' >>site.tmp
85         @echo 'set compile_c "$(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c "' >>site.tmp
86         @echo 'set compile_cxx "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) - c"' >> site.tmp
87         @echo 'set link "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags)"' >>site.tmp
88         @echo 'set llvmgcc "$(LLVMGCC)"' >> site.tmp
89         @echo 'set llvmgxx "$(LLVMGCC)"' >> site.tmp
90         @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
91         @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
92         @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
93         @test ! -f site.exp || \
94         sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
95         @-rm -f site.bak
96         @test ! -f site.exp || mv site.exp site.bak
97         @mv site.tmp site.exp