target-xtensa: allow using core configuration in tests
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 10 Feb 2014 16:20:52 +0000 (20:20 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 24 Feb 2014 00:47:01 +0000 (04:47 +0400)
Add path to the core configuration directory to test build command and
replace .include asm directive with #include to enable preprocessing.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
30 files changed:
tests/tcg/xtensa/Makefile
tests/tcg/xtensa/macros.inc
tests/tcg/xtensa/test_b.S
tests/tcg/xtensa/test_bi.S
tests/tcg/xtensa/test_boolean.S
tests/tcg/xtensa/test_break.S
tests/tcg/xtensa/test_bz.S
tests/tcg/xtensa/test_clamps.S
tests/tcg/xtensa/test_extui.S
tests/tcg/xtensa/test_fail.S
tests/tcg/xtensa/test_interrupt.S
tests/tcg/xtensa/test_loop.S
tests/tcg/xtensa/test_mac16.S
tests/tcg/xtensa/test_max.S
tests/tcg/xtensa/test_min.S
tests/tcg/xtensa/test_mmu.S
tests/tcg/xtensa/test_mul16.S
tests/tcg/xtensa/test_mul32.S
tests/tcg/xtensa/test_nsa.S
tests/tcg/xtensa/test_pipeline.S
tests/tcg/xtensa/test_quo.S
tests/tcg/xtensa/test_rem.S
tests/tcg/xtensa/test_rst0.S
tests/tcg/xtensa/test_s32c1i.S
tests/tcg/xtensa/test_sar.S
tests/tcg/xtensa/test_sext.S
tests/tcg/xtensa/test_shift.S
tests/tcg/xtensa/test_sr.S
tests/tcg/xtensa/test_timer.S
tests/tcg/xtensa/test_windowed.S

index 1b519ca..38f23b1 100644 (file)
@@ -1,10 +1,11 @@
 -include ../../../config-host.mak
 
-CROSS=xtensa-dc232b-elf-
+CORE=dc232b
+CROSS=xtensa-$(CORE)-elf-
 
 ifndef XT
 SIM = ../../../xtensa-softmmu/qemu-system-xtensa
-SIMFLAGS = -M sim -cpu dc232b -nographic -semihosting $(EXTFLAGS) -kernel
+SIMFLAGS = -M sim -cpu $(CORE) -nographic -semihosting $(EXTFLAGS) -kernel
 SIMDEBUG = -s -S
 else
 SIM = xt-run
@@ -17,6 +18,8 @@ AS      = $(CROSS)gcc -x assembler-with-cpp
 LD      = $(CROSS)ld
 
 XTENSA_SRC_PATH = $(SRC_PATH)/tests/tcg/xtensa
+INCLUDE_DIRS = $(XTENSA_SRC_PATH) $(SRC_PATH)/target-xtensa/core-$(CORE)
+XTENSA_INC = $(addprefix -I,$(INCLUDE_DIRS))
 
 LDFLAGS = -T$(XTENSA_SRC_PATH)/linker.ld
 
@@ -56,10 +59,10 @@ TESTCASES += test_windowed.tst
 all: build
 
 %.o: $(XTENSA_SRC_PATH)/%.c
-       $(CC) -I$(XTENSA_SRC_PATH) $(CFLAGS) -c $< -o $@
+       $(CC) $(XTENSA_INC) $(CFLAGS) -c $< -o $@
 
 %.o: $(XTENSA_SRC_PATH)/%.S
-       $(AS) -Wa,-I,$(XTENSA_SRC_PATH) $(ASFLAGS) -c $< -o $@
+       $(CC) $(XTENSA_INC) $(ASFLAGS) -c $< -o $@
 
 %.tst: %.o $(XTENSA_SRC_PATH)/macros.inc $(CRT) Makefile
        $(LD) $(LDFLAGS) $(NOSTDFLAGS) $(CRT) $< -o $@
index ead8528..4ebd30a 100644 (file)
@@ -1,3 +1,5 @@
+#include "core-isa.h"
+
 .macro test_suite name
 .data
 status: .word result
index 6cbe5f1..8e81f95 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite b
 
index 6a5f1df..4f94c0c 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite bi
 
index 50e6d2c..eac40e0 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite boolean
 
index 7574cbe..775cd7c 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 #define debug_level 6
 #define debug_vector level6
index f9ba6e2..b681350 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite bz
 
index c186cc9..3efabfd 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite clamps
 
index 5d55451..c32bb82 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite extui
 
index e8d1b42..1c26d50 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite fail
 
index 68b3ee1..334ddab 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite interrupt
 
index 1c240e8..5755578 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite loop
 
index 5ddd160..512025d 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite mac16
 
index 2534c9d..3caa207 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite max
 
index 6d9ddeb..551cf59 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite min
 
index 4bc34e5..099031f 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite mmu
 
index bf94376..98fa704 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite mul16
 
index fdaf573..b288ead 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite mul32
 
index a5fe5de..479b2e2 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite nsa
 
index 6be6085..f418c11 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 .purgem test
 .macro test name
index 12debf1..5b3ae38 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite quo
 
index bb0d5fe..6357e52 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite rem
 
index 3eda565..a73366b 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite rst0
 
index 4536015..93b575d 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite s32c1i
 
index 40c649f..b615a55 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite sar
 
index 04dc650..087a633 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite sext
 
index a8e4364..5df9ed4 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite shift
 
index 470c03d..4fac46e 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite sr
 
index 1041cc6..f8c6f74 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite timer
 
index cb2d39e..3de6d37 100644 (file)
@@ -1,4 +1,4 @@
-.include "macros.inc"
+#include "macros.inc"
 
 test_suite windowed