Skip to content

Commit

Permalink
target-xtensa: allow using core configuration in tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jcmvbkbc committed Feb 24, 2014
1 parent d0fa1f0 commit a2e6707
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 32 deletions.
11 changes: 7 additions & 4 deletions tests/tcg/xtensa/Makefile
@@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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 $@
Expand Down
2 changes: 2 additions & 0 deletions tests/tcg/xtensa/macros.inc
@@ -1,3 +1,5 @@
#include "core-isa.h"

.macro test_suite name
.data
status: .word result
Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_b.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite b

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_bi.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite bi

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_boolean.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite boolean

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_break.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

#define debug_level 6
#define debug_vector level6
Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_bz.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite bz

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_clamps.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite clamps

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_extui.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite extui

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_fail.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite fail

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_interrupt.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite interrupt

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_loop.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite loop

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_mac16.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite mac16

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_max.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite max

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_min.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite min

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_mmu.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite mmu

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_mul16.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite mul16

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_mul32.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite mul32

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_nsa.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite nsa

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_pipeline.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

.purgem test
.macro test name
Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_quo.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite quo

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_rem.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite rem

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_rst0.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite rst0

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_s32c1i.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite s32c1i

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_sar.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite sar

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_sext.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite sext

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_shift.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite shift

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_sr.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite sr

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_timer.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite timer

Expand Down
2 changes: 1 addition & 1 deletion tests/tcg/xtensa/test_windowed.S
@@ -1,4 +1,4 @@
.include "macros.inc"
#include "macros.inc"

test_suite windowed

Expand Down

0 comments on commit a2e6707

Please sign in to comment.