Use llvmc to compile test cases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18053 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2004-11-20 21:03:34 +00:00
parent 08602e5a30
commit 150e8422ef

View File

@ -31,37 +31,30 @@ IO_TESTS = space tab out_chr out_num out_str
TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
$(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
STKRC_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/stkrc
LLVMC = $(LLVMToolDir)/llvmc
all :: test_each
test_each: $(TESTS)
$(Echo) "Running Tests..."
$(Verb) LD_LIBRARY_PATH=$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) $(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS)
$(Verb) LD_LIBRARY_PATH=$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) \
$(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS)
%.bc : %.st Makefile
$(Echo) "Compiling And Optimizing $< to $*.bc"
$(Verb)$(STKRC_EXEC) -f -O4 -s 2048 -o $*.bc $(BUILD_SRC_DIR)/$*.st
% : %.st Makefile testing.bc
$(Echo) "Building $*"
$(Verb)$(LLVMC) -O4 -o $@ $< testing.bc -lstkr_runtime -lcrtend
%.s : %.bc testing.bc
$(Echo) "Assembling $< to $*.s"
$(Verb)$(LLINK) $*.bc testing.bc -o $*.bcl
$(Verb)$(LLC) -f -o $*.s $*.bcl
% : %.s
$(Echo) "Linking $*"
$(Verb)$(CC) -ggdb -L$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) -lstkr_runtime -o $* $*.s
%.ll : %.bc
$(Echo) "Disassembling $< to $*.ll"
$(Verb)$(LDIS) -dis -o $*.ll $<
testing.bc : testing.st Makefile
$(Echo) "Compiling $*"
$(Verb)$(LLVMC) -O3 -c -o $@ $<
TESTS_LL = $(TESTS:%=%.ll)
TESTS_BC = $(TESTS:%=%.bc)
TESTS_S = $(TESTS:%=%.s)
clean ::
$(Verb)rm -f gmon.out $(TESTS_LL) $(TESTS_BC) $(TESTS_S) $(TESTS) testing.bc testing.s testing.ll
$(Verb)rm -f gmon.out $(TESTS_LL) $(TESTS_BC) $(TESTS_S) $(TESTS) \
testing.bc testing.s testing.ll
.SUFFIXES: .st .s .ll .bc
.PRECIOUS: %.s %.ll %.bc %.st