target/arm: add ARMv6-M UNDEFINED 32-bit instruction test
RFC 1/1 target/arm: add ARMv6-M UNDEFINED 32-bit instruction test
Test that 32-bit instructions declared UNDEFINED in the ARMv6-M Reference Manual really do raise an exception.
The Intel HEX (.hex) file is included to save people the trouble of installing a cross-compiler toolchain.
To run the test (make sure qemu-system-arm is in your $PATH):
$ cd tests/tcg/arm $ make run-test-armv6m-undef
Based-on: http://github.com/stefanha/qemu/commits/microbit
---
Hi Julia,
Several instructions are currently not raising an exception. I have commented them out with "FAIL". Maybe your 32-bit instruction work will fix them. Otherwise they require additional investigation.
Hi Peter and Alex,
Is this along the lines you were thinking of when we discussed this type of test on IRC?
tests/tcg/arm/Makefile | 21 +++++ tests/tcg/arm/test-armv6m-undef.S | 119 ++++++++++++++++++++++++++++ tests/tcg/arm/test-armv6m-undef.hex | 17 ++++ tests/tcg/arm/test-armv6m-undef.ld | 21 +++++ 4 files changed, 178 insertions(+) create mode 100644 tests/tcg/arm/Makefile create mode 100644 tests/tcg/arm/test-armv6m-undef.S create mode 100644 tests/tcg/arm/test-armv6m-undef.hex create mode 100644 tests/tcg/arm/test-armv6m-undef.ld
tests/tcg/arm/Makefile new file +21 -0
@@ -0,0 +1,21 @@ +CC = arm-linux-gnu-gcc +OBJCOPY = arm-linux-gnu-objcopy + +SOURCES = $(wildcard *.S) +BINARIES = $(patsubst %.S,%.hex,$(SOURCES)) + +.PHONY: clean + +all: $(BINARIES) + +clean: + rm -f $(BINARIES) *.o + +%.o: %.S %.ld + $(CC) -nostdlib -Wl,--build-id=none -x assembler-with-cpp -T $(patsubst %.S,%.ld,$<) -x assembler-with-cpp -o $@ $< + +%.hex: %.o + $(OBJCOPY) -O ihex $< $@ + +run-test-armv6m-undef: test-armv6m-undef.hex + qemu-system-arm -semihosting -M microbit -kernel $<
tests/tcg/arm/test-armv6m-undef.S new file +119 -0
119 lines not on this page · raw message
tests/tcg/arm/test-armv6m-undef.hex new file +17 -0
@@ -0,0 +1,17 @@ +:1000000000400020C100000000000000D5000000FA +:1000100000000000000000000000000000000000E0 +:1000200000000000000000000000000000000000D0 +:1000300000000000000000000000000000000000C0 +:1000400000000000000000000000000000000000B0 +:1000500000000000000000000000000000000000A0 +:100060000000000000000000000000000000000090 +:100070000000000000000000000000000000000080 +:100080000000000000000000000000000000000070 +:100090000000000000000000000000000000000060 +:1000A0000000000000000000000000000000000050 +:1000B0000000000000000000000000000000000040 +:1000C00000F0000004E0F0F700A001E0012005E0EE +:1000D000002003E0069806300690704700210128B2 +:0C00E00000D101491820ABBE2600020030 +:04000003000000C138 +:00000001FF
tests/tcg/arm/test-armv6m-undef.ld new file +21 -0
@@ -0,0 +1,21 @@ +ENTRY(exc_reset_thumb) + +SECTIONS +{ + . = 0x0; + .text : { + *(.text) + } + .data : { + *(.data) + } + .rodata : { + *(.rodata) + } + .bss : { + *(.bss) + } + /DISCARD/ : { + *(.ARM.attributes) + } +}
Signature · 1 line
2.17.1