shithub: rgbds

Download patch

ref: 746117095688be84f9f4611f14d42644bf761776
parent: 57d966d6e00a94fe54d335cec750034af08c892a
author: Eldred Habert <eldredhabert0@gmail.com>
date: Sun Mar 28 17:11:20 EDT 2021

Add LOAD FRAGMENT pc test (#800)

Reproduces a reported problem, fix pending

--- /dev/null
+++ b/test/link/load-fragment/a.asm
@@ -1,0 +1,4 @@
+SECTION "main", ROM0
+LOAD FRAGMENT "test", SRAM
+	db 0
+ENDL
--- /dev/null
+++ b/test/link/load-fragment/b.asm
@@ -1,0 +1,7 @@
+
+SECTION "SECTION2", ROM0
+LOAD FRAGMENT "test", SRAM
+    jr Label
+Label:
+	dw Label
+ENDL
binary files /dev/null b/test/link/load-fragment/out.gb differ
--- a/test/link/test.sh
+++ b/test/link/test.sh
@@ -130,13 +130,24 @@
 tryCmp $gbtemp $gbtemp2
 rc=$(($? || $rc))
 
+i="load-fragment.asm"
+startTest
+$RGBASM -o $otemp load-fragment/a.asm
+$RGBASM -o $gbtemp2 load-fragment/b.asm
+rgblinkQuiet -o $gbtemp $otemp $gbtemp2 2>$outtemp
+tryDiff load-fragment/out.err $outtemp
+rc=$(($? || $rc))
+dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < load-fragment/out.gb)) > $otemp 2>/dev/null
+tryCmp load-fragment/out.gb $otemp
+rc=$(($? || $rc))
+
 i="overlay.asm"
 startTest
 $RGBASM -o $otemp overlay/a.asm
 rgblinkQuiet -o $gbtemp -t -O overlay/overlay.gb $otemp > $outtemp 2>&1
-# This test does not trim its output with 'dd' because it needs to verify the correct output size
 tryDiff overlay/out.err $outtemp
 rc=$(($? || $rc))
+# This test does not trim its output with 'dd' because it needs to verify the correct output size
 tryCmp overlay/out.gb $gbtemp
 rc=$(($? || $rc))