Skip to content

Commit 7a159bb

Browse files
committed
Integrate ABI conformance test suite for Arm32
To validate the ABI compliance when targeting the Arm architecture, this commit introduces a new test suite that performs the relevant checks, including the following categories: - Structure Passing: tests passing a structure instance as an argument. - Currently, only one test case is included, which validates passing a small structure. - Stack Alignment: verifies that the stack is properly aligned when calling a function. - Parameter Passing: contains several test cases to validate calling functions with different numbers of arguments. - Register Preservation: verifies whether the content of specific registers are preserved after a function returns. - Return Values: verifies that the return value is correct after a function retruns.
1 parent a75b1d7 commit 7a159bb

File tree

2 files changed

+622
-1
lines changed

2 files changed

+622
-1
lines changed

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $(OUT)/tests/%.elf: tests/%.c $(OUT)/$(STAGE0)
9191
chmod +x $@ ; $(PRINTF) "Running $@ ...\n"
9292
$(Q)$(TARGET_EXEC) $@ && $(call pass)
9393

94-
check: check-stage0 check-stage2
94+
check: check-stage0 check-stage2 check-abi-stage0 check-abi-stage2
9595

9696
check-stage0: $(OUT)/$(STAGE0) $(TESTBINS) tests/driver.sh
9797
$(VECHO) " TEST STAGE 0\n"
@@ -118,6 +118,21 @@ check-snapshot: $(OUT)/$(STAGE0) tests/check-snapshots.sh
118118
tests/check-snapshots.sh $(ARCH) $(DYNLINK)
119119
$(VECHO) " OK\n"
120120

121+
# TODO: Add an ABI conformance test suite for the RISC-V architecture
122+
check-abi-stage0: $(OUT)/$(STAGE0)
123+
$(Q)if [ "$(ARCH)" = "arm" ]; then \
124+
tests/$(ARCH)-abi.sh 0 $(DYNLINK); \
125+
else \
126+
echo "Skip ABI compliance validation"; \
127+
fi
128+
129+
check-abi-stage2: $(OUT)/$(STAGE2)
130+
$(Q)if [ "$(ARCH)" = "arm" ]; then \
131+
tests/$(ARCH)-abi.sh 2 $(DYNLINK); \
132+
else \
133+
echo "Skip ABI compliance validation"; \
134+
fi
135+
121136
update-snapshots: tests/update-snapshots.sh
122137
$(Q)$(foreach SNAPSHOT_ARCH, $(ARCHS), $(MAKE) distclean config update-snapshot ARCH=$(SNAPSHOT_ARCH) DYNLINK=0 --silent;)
123138
$(Q)$(MAKE) distclean config update-snapshot ARCH=arm DYNLINK=1 --silent

0 commit comments

Comments
 (0)