aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
blob: 44ac0bef65ff3843917f3c0ca1fbfb6fc4fb7073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LLC  := ../tools/Debug/llc
AS   := ../tools/Debug/as
LLCOPTS := -dsched y
ARCHFLAGS =

CC = /opt/SUNWspro/bin/cc
CCFLAGS = -g -xarch=v9
## CC = gcc
## CCFLAGS = -g -xarch=v9 ## -mcpu=v9

TESTS := $(wildcard *.ll)

LLCTESTS := $(shell /bin/ls *.ll | grep -v testswitch | grep -v opttest | grep -v xx | grep -v calltest )


test all : testasmdis testopt testcodegen
	@echo "All tests successfully completed!"

testasmdis  : $(TESTS:%.ll=%.ll.asmdis)
	@echo "All assembler/disassembler test succeeded!"

testopt     : $(TESTS:%.ll=%.ll.opt)

testselect  : $(LLCTESTS:%.ll=%.mc)

testsched   : $(LLCTESTS:%.ll=%.mc)

testcodegen : $(LLCTESTS:%.ll=%.mc)

testsparc   : $(LLCTESTS:%.ll=%.s)

clean :
	rm -f *.[123] *.bc *.mc *.s core

%.asmdis: %
	@echo "Running assembler/disassembler test on $<"
	@./TestAsmDisasm.sh $<

%.opt: %
	@echo "Running optimizier test on $<"
	@./TestOptimizer.sh $<

%.bc: %.ll
	$(AS) $< -f

%.mc: %.ll $(LLC) $(AS)
	@echo "Generating machine instructions for $<"
	$(AS) < $< | $(LLC) $(LLCOPTS) > $@

%.s: %.ll $(LLC) $(AS)
	$(AS) < $<  | $(LLC) > $@

## %.o: %.s %.ll
## 	/usr/ccs/bin/as $(ARCHFLAGS) $<


%.o: %.s
	$(CC) -c $(CCFLAGS) $<

%: %.o
	$(CC) -o $@ $(CCFLAGS) $<