diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c4a2a60..00f2dd4b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,6 +64,10 @@ jobs: make distclean && make ENABLE_EXT_F=0 check -j$(nproc) make distclean && make ENABLE_EXT_C=0 check -j$(nproc) make distclean && make ENABLE_SDL=0 check -j$(nproc) + - name: misalignment test in block emulation + run: | + make -C tests/system/alignment/ + make distclean && make ENABLE_EXT_C=0 ENABLE_SYSTEM=1 misalign-in-blk-emu -j$(nproc) - name: gdbstub test run: | make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(nproc) diff --git a/Makefile b/Makefile index 8d8a4a12..58a41ae4 100644 --- a/Makefile +++ b/Makefile @@ -289,6 +289,16 @@ misalign: $(BIN) artifact $(PRINTF) "Failed.\n"; \ fi +EXPECTED_misalign = MISALIGNED INSTRUCTION FETCH TEST PASSED! +misalign-in-blk-emu: $(BIN) + $(Q)$(PRINTF) "Running misalign.elf ... "; \ + if [ "$(shell $(BIN) tests/system/alignment/misalign.elf | tail -n 2)" = "$(strip $(EXPECTED_misalign)) inferior exit code 0" ]; then \ + $(call notice, [OK]); \ + else \ + $(PRINTF) "Failed.\n"; \ + exit 1; \ + fi; + # Non-trivial demonstration programs ifeq ($(call has, SDL), 1) doom_action := (cd $(OUT); ../$(BIN) riscv32/doom)