mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
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:
parent
08602e5a30
commit
150e8422ef
@ -31,37 +31,30 @@ IO_TESTS = space tab out_chr out_num out_str
|
|||||||
TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
|
TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
|
||||||
$(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
|
$(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
|
||||||
|
|
||||||
STKRC_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/stkrc
|
LLVMC = $(LLVMToolDir)/llvmc
|
||||||
|
|
||||||
all :: test_each
|
all :: test_each
|
||||||
|
|
||||||
test_each: $(TESTS)
|
test_each: $(TESTS)
|
||||||
$(Echo) "Running 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
|
% : %.st Makefile testing.bc
|
||||||
$(Echo) "Compiling And Optimizing $< to $*.bc"
|
$(Echo) "Building $*"
|
||||||
$(Verb)$(STKRC_EXEC) -f -O4 -s 2048 -o $*.bc $(BUILD_SRC_DIR)/$*.st
|
$(Verb)$(LLVMC) -O4 -o $@ $< testing.bc -lstkr_runtime -lcrtend
|
||||||
|
|
||||||
%.s : %.bc testing.bc
|
testing.bc : testing.st Makefile
|
||||||
$(Echo) "Assembling $< to $*.s"
|
$(Echo) "Compiling $*"
|
||||||
$(Verb)$(LLINK) $*.bc testing.bc -o $*.bcl
|
$(Verb)$(LLVMC) -O3 -c -o $@ $<
|
||||||
$(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 $<
|
|
||||||
|
|
||||||
TESTS_LL = $(TESTS:%=%.ll)
|
TESTS_LL = $(TESTS:%=%.ll)
|
||||||
TESTS_BC = $(TESTS:%=%.bc)
|
TESTS_BC = $(TESTS:%=%.bc)
|
||||||
TESTS_S = $(TESTS:%=%.s)
|
TESTS_S = $(TESTS:%=%.s)
|
||||||
|
|
||||||
clean ::
|
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
|
.SUFFIXES: .st .s .ll .bc
|
||||||
.PRECIOUS: %.s %.ll %.bc %.st
|
.PRECIOUS: %.s %.ll %.bc %.st
|
||||||
|
Loading…
x
Reference in New Issue
Block a user