1 -include ../../../config-host.mak
4 CROSS=xtensa-$(CORE)-elf-
7 SIM = ../../../xtensa-softmmu/qemu-system-xtensa
8 SIMFLAGS = -M sim -cpu $(CORE) -nographic -semihosting $(EXTFLAGS) -kernel
12 SIMFLAGS = --xtensa-core=DC_B_232L --exit_with_target_code $(EXTFLAGS)
13 SIMDEBUG = --gdbserve=0
18 AS = $(CROSS)gcc -x assembler-with-cpp
21 XTENSA_SRC_PATH = $(SRC_PATH)/tests/tcg/xtensa
22 INCLUDE_DIRS = $(XTENSA_SRC_PATH) $(SRC_PATH)/target-xtensa/core-$(CORE)
23 XTENSA_INC = $(addprefix -I,$(INCLUDE_DIRS))
29 TESTCASES += test_b.tst
30 TESTCASES += test_bi.tst
31 #TESTCASES += test_boolean.tst
32 TESTCASES += test_break.tst
33 TESTCASES += test_bz.tst
34 TESTCASES += test_cache.tst
35 TESTCASES += test_clamps.tst
36 TESTCASES += test_extui.tst
37 TESTCASES += test_fail.tst
38 TESTCASES += test_interrupt.tst
39 TESTCASES += test_loop.tst
40 TESTCASES += test_mac16.tst
41 TESTCASES += test_max.tst
42 TESTCASES += test_min.tst
43 TESTCASES += test_mmu.tst
44 TESTCASES += test_mul16.tst
45 TESTCASES += test_mul32.tst
46 TESTCASES += test_nsa.tst
48 TESTCASES += test_pipeline.tst
50 TESTCASES += test_quo.tst
51 TESTCASES += test_rem.tst
52 TESTCASES += test_rst0.tst
53 TESTCASES += test_s32c1i.tst
54 TESTCASES += test_sar.tst
55 TESTCASES += test_sext.tst
56 TESTCASES += test_shift.tst
57 TESTCASES += test_sr.tst
58 TESTCASES += test_timer.tst
59 TESTCASES += test_windowed.tst
63 linker.ld: $(XTENSA_SRC_PATH)/linker.ld.S
64 $(HOST_CC) $(XTENSA_INC) -E -P $< -o $@
66 %.o: $(XTENSA_SRC_PATH)/%.c
67 $(CC) $(XTENSA_INC) $(CFLAGS) -c $< -o $@
69 %.o: $(XTENSA_SRC_PATH)/%.S
70 $(CC) $(XTENSA_INC) $(ASFLAGS) -c $< -o $@
72 %.tst: %.o linker.ld $(XTENSA_SRC_PATH)/macros.inc $(CRT) Makefile
73 $(LD) $(LDFLAGS) $(NOSTDFLAGS) $(CRT) $< -o $@
77 check: $(addprefix run-, $(TESTCASES))
80 $(SIM) $(SIMFLAGS) ./$<
82 run-test_fail.tst: test_fail.tst
83 ! $(SIM) $(SIMFLAGS) ./$<
86 $(SIM) $(SIMDEBUG) $(SIMFLAGS) ./$<
88 host-debug-%.tst: %.tst
89 gdb --args $(SIM) $(SIMFLAGS) ./$<
92 $(RM) -fr $(TESTCASES) $(CRT) linker.ld