test: port the w6a ELF-object observers to ww

elfobj_test.ww (test/object, on testenv) absorbs 500_w6a, 510_dataw,
and 520_datar: ELF64 header magic/class over the 4 inline programs,
DATAW section/symbol layout plus the 6-section no-DATAW legacy
invariant 991 depends on, and the DATAR .rela.data reloc through
link and run. Strengthened: the reloc symbol is resolved to
'greeting' (declared but never implemented in the C carrier).
This commit is contained in:
2026-08-08 14:46:05 +09:00
parent 6657d68349
commit 42d8fbe950
5 changed files with 364 additions and 542 deletions

View File

@@ -388,6 +388,15 @@ ASM_WW_TESTS = test/asm/modshadow_test.ww test/asm/sret_test.ww \
test/asm/callarg_test.ww test/asm/chain_test.ww \
test/asm/dataemit_test.ww test/asm/matchdispatch_test.ww
ASM_WW_TARGETS = $(ASM_WW_TESTS:%=wwtest/%)
# Ww-native assembler/linker OBJECT-level observers: single-file ww
# tests under test/object/ on the test/testenv helper package, porting
# the residual w6a/w6l artifact C carriers (ELF section/symbol/reloc
# layout, program-header split and BSS trim, archive selectivity,
# linker flag capacity, assembler input gates). Compiler/driver gates
# like test/sep: they run under test-compiler.
OBJECT_WW_TESTS = test/object/elfobj_test.ww
OBJECT_WW_TARGETS = $(OBJECT_WW_TESTS:%=wwtest/%)
BOOTSTRAP_WRAPPER_SOURCES = test/wcc/950_selfcheck.c \
test/wcc/991_w6a_ww.c \
test/wcc/992_w6l_ww.c test/wcc/993_ww_ww.c \
@@ -473,7 +482,8 @@ test-compiler-smoke: $(WWFIXTURE_BIN) $(BIN)/w6c_ww $(BIN)/w6a_ww \
# gates that cannot be represented by a single compiler fixture, plus the
# ww-native sep observers that replaced the 989_sep* carriers.
test-compiler: $(WWFIXTURE_BIN) $(WRAPPER_TOOLS) $(COMPILER_WRAPPER_BINS) \
$(SEP_WW_TARGETS) $(XMOD_WW_TARGETS) $(ASM_WW_TARGETS)
$(SEP_WW_TARGETS) $(XMOD_WW_TARGETS) $(ASM_WW_TARGETS) \
$(OBJECT_WW_TARGETS)
@$(CURDIR)/$(WWFIXTURE_BIN) -j $(JOBS)
@set -e; for t in $(COMPILER_WRAPPER_BINS); do \
echo "compiler artifact $$t"; BIN=$(CURDIR)/$(BIN) $(CURDIR)/$$t; \
@@ -543,6 +553,18 @@ $(ASM_WW_TARGETS): wwtest/%: $(BIN)/ww $(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
-w $(WWBUILD)/wwtest/$(subst /,_,$*) \
-I $(CURDIR)/test $*
# The object observers feed hand-written .s (and w6c output) to the
# assemblers and linkers of both stages and parse the resulting ELF
# artifacts, so w6c plus both stages' w6a/w6l are prerequisites;
# libwwrt.a carries the $(OBJ)/rt/start.o the archive rows link.
$(OBJECT_WW_TARGETS): wwtest/%: $(BIN)/ww $(BIN)/w6c $(BIN)/w6a \
$(BIN)/w6l $(LIB)/libwwrt.a $(BIN)/w6a_ww $(BIN)/w6l_ww
@echo "ww test $*"
@mkdir -p $(WWBUILD)/wwtest/$(subst /,_,$*)
@WW_TEST_REPO=$(CURDIR) $(BIN)/ww test \
-w $(WWBUILD)/wwtest/$(subst /,_,$*) \
-I $(CURDIR)/test $*
test-lang: $(LANG_TEST_TARGETS)
test-library: $(LIBRARY_TEST_TARGETS) $(BIN)/w6c $(BIN)/w6c_ww \