Skip to content

Commit a28615f

Browse files
committed
CI: Add misaligned access handling test suite during block emulation
1 parent 2231ffe commit a28615f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ jobs:
6464
make distclean && make ENABLE_EXT_F=0 check -j$(nproc)
6565
make distclean && make ENABLE_EXT_C=0 check -j$(nproc)
6666
make distclean && make ENABLE_SDL=0 check -j$(nproc)
67+
- name: misalignment test in block emulation
68+
run: |
69+
make -C tests/system/alignment/
70+
make distclean && make ENABLE_EXT_C=0 ENABLE_SYSTEM=1 misalign-in-blk-emu -j$(nproc)
6771
- name: gdbstub test
6872
run: |
6973
make distclean && make ENABLE_GDBSTUB=1 gdbstub-test -j$(nproc)

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,16 @@ misalign: $(BIN) artifact
289289
$(PRINTF) "Failed.\n"; \
290290
fi
291291

292+
EXPECTED_misalign = MISALIGNED INSTRUCTION FETCH TEST PASSED!
293+
misalign-in-blk-emu: $(BIN)
294+
$(Q)$(PRINTF) "Running misalign.elf ... "; \
295+
if [ "$(shell $(BIN) tests/system/alignment/misalign.elf | tail -n 2)" = "$(strip $(EXPECTED_misalign)) inferior exit code 0" ]; then \
296+
$(call notice, [OK]); \
297+
else \
298+
$(PRINTF) "Failed.\n"; \
299+
exit 1; \
300+
fi;
301+
292302
# Non-trivial demonstration programs
293303
ifeq ($(call has, SDL), 1)
294304
doom_action := (cd $(OUT); ../$(BIN) riscv32/doom)

0 commit comments

Comments
 (0)