commit c64b344d2f72743c6432bfbec901f47d214f99ba
parent 4fa8f8f076759c67fa71fb42951134ffa8759dbe
Author: Ryan Sepassi <rsepassi@gmail.com>
Date: Mon, 25 May 2026 15:23:02 -0700
Fix debug DWARF test targets
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/debug/roundtrip_unit.c b/test/debug/roundtrip_unit.c
@@ -160,7 +160,7 @@ static int run_one(CfreeArchKind arch, uint32_t nop_word, const char* tag) {
{
/* Set a primary file. */
u32 fid = 0;
- (void)source_add_memory(c->sources, "p01.c", &fid);
+ (void)source_add_memory(c->sources, SLICE_LIT("p01.c"), &fid);
SrcLoc decl = {fid, 1, 0};
SrcLoc l10 = {fid, 10, 0};
DebugTypeId int_tid =
@@ -366,7 +366,7 @@ static int run_x64_debug_line_check(void) {
EXPECT(xd != NULL, "x64 debug_new returned NULL");
if (xd) {
u32 fid = 0;
- (void)source_add_memory(xc->sources, "x64.c", &fid);
+ (void)source_add_memory(xc->sources, SLICE_LIT("x64.c"), &fid);
SrcLoc decl = {fid, 1, 0};
SrcLoc l10 = {fid, 10, 0};
SrcLoc l11 = {fid, 11, 0};
diff --git a/test/test.mk b/test/test.mk
@@ -162,17 +162,17 @@ test-objdump-driver: bin
@CFREE=$(abspath $(BIN)) sh test/objdump/run.sh
# DWARF consumer unit test: builds a hand-crafted DWARF-bearing ELF in
-# memory and exercises every cfree_dwarf_* entry. Depends only on
-# libcfree.a — the consumer reads bytes; producer involvement isn't
-# required (per doc/DWARF.md §7).
+# memory and exercises every cfree_dwarf_* entry. It reaches into the
+# internal object builder to synthesize the fixture, so link individual
+# lib objects rather than libcfree.a (which hides internal symbols).
DWARF_TEST_BIN = build/test/dwarf_test
test-dwarf: $(DWARF_TEST_BIN)
$(DWARF_TEST_BIN)
-$(DWARF_TEST_BIN): test/dwarf/dwarf_test.c $(LIB_AR)
+$(DWARF_TEST_BIN): test/dwarf/dwarf_test.c $(LIB_OBJS)
@mkdir -p $(dir $@)
- $(CC) $(TEST_HOST_CFLAGS) -Isrc test/dwarf/dwarf_test.c $(LIB_AR) -o $@
+ $(CC) $(TEST_HOST_CFLAGS) -Isrc test/dwarf/dwarf_test.c $(LIB_OBJS) -o $@
# DWARF producer self-roundtrip unit test. Drives Debug directly, calls
# debug_emit, asserts the produced sections have valid DWARF 5 structure
@@ -184,9 +184,9 @@ DEBUG_TEST_BIN = build/test/debug_roundtrip_unit
test-debug: $(DEBUG_TEST_BIN)
$(DEBUG_TEST_BIN)
-$(DEBUG_TEST_BIN): test/debug/roundtrip_unit.c $(LIB_AR)
+$(DEBUG_TEST_BIN): test/debug/roundtrip_unit.c $(LIB_OBJS)
@mkdir -p $(dir $@)
- $(CC) $(TEST_HOST_CFLAGS) -Isrc test/debug/roundtrip_unit.c $(LIB_AR) -o $@
+ $(CC) $(TEST_HOST_CFLAGS) -Isrc test/debug/roundtrip_unit.c $(LIB_OBJS) -o $@
# aa64 ISA descriptor-table unit test (doc/ASM.md phase 2). Covers
# every AA64Format the table maps and the alias-precedence invariant