Skip to content

Commit a0262df

Browse files
committed
CI: Misalign access handling test suite for block emulation
1 parent 46f9a6e commit a0262df

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
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)

tests/system/alignment/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define TEST_LOGGER(msg) \
1919
{ \
2020
char _msg[] = msg; \
21-
TEST_OUTPUT(_msg, sizeof(_msg)); \
21+
TEST_OUTPUT(_msg, sizeof(_msg) - 1); \
2222
}
2323

2424
extern int *misalign_data;

0 commit comments

Comments
 (0)