shithub: rgbds

Download patch

ref: 30a95d735ac2f62c6ae3705fb4c052812e7a3472
parent: f01a227470c9fa8eb89b272190533e8ac3b7814f
author: ISSOtm <[email protected]>
date: Thu Feb 13 15:20:35 EST 2020

Improve testing PC

--- a/test/asm/label-diff.asm
+++ b/test/asm/label-diff.asm
@@ -52,6 +52,8 @@
 	; Diffing PC and a label from here should work
 LocalFixed:
 	print_diff LocalFixed, @
+	ds 69
+	print_diff LocalFixed, @
 
 SECTION "Floating PC", ROM0
 	; Diffing a constant and PC cannot work
@@ -64,4 +66,6 @@
 	print_diff @, @
 	; Diffing PC and a label from here should work
 LocalFloating:
+	print_diff LocalFloating, @
+	ds 42
 	print_diff LocalFloating, @
--- a/test/asm/label-diff.err
+++ b/test/asm/label-diff.err
@@ -22,16 +22,16 @@
     Expected constant expression: 'Unknown' is not constant at assembly time
 ERROR: label-diff.asm(49) -> label-diff.asm::print_diff(22):
     Expected constant expression: 'Unknown' is not constant at assembly time
-ERROR: label-diff.asm(58) -> label-diff.asm::print_diff(20):
-    Expected constant expression: PC is not constant at assembly time
-ERROR: label-diff.asm(58) -> label-diff.asm::print_diff(22):
-    Expected constant expression: PC is not constant at assembly time
 ERROR: label-diff.asm(60) -> label-diff.asm::print_diff(20):
-    Expected constant expression: 'Known' is not constant at assembly time
+    Expected constant expression: PC is not constant at assembly time
 ERROR: label-diff.asm(60) -> label-diff.asm::print_diff(22):
     Expected constant expression: PC is not constant at assembly time
 ERROR: label-diff.asm(62) -> label-diff.asm::print_diff(20):
-    Expected constant expression: 'Unknown' is not constant at assembly time
+    Expected constant expression: 'Known' is not constant at assembly time
 ERROR: label-diff.asm(62) -> label-diff.asm::print_diff(22):
+    Expected constant expression: PC is not constant at assembly time
+ERROR: label-diff.asm(64) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(64) -> label-diff.asm::print_diff(22):
     Expected constant expression: PC is not constant at assembly time
 error: Assembly aborted (18 errors)!
--- a/test/asm/label-diff.out
+++ b/test/asm/label-diff.out
@@ -20,6 +20,8 @@
 $0
 $0
 $0
+$FFFFFFBB
+$45
 $0
 $0
 $0
@@ -30,3 +32,5 @@
 $0
 $0
 $0
+$FFFFFFD6
+$2A
--- /dev/null
+++ b/test/asm/pc.asm
@@ -1,0 +1,10 @@
+SECTION "fixed", ROM0[420]
+	PRINTT "{@}\n"
+	ds 69
+	PRINTT "{@}\n"
+
+; FIXME: expected to land at $0000
+SECTION "floating", ROM0
+	db @
+	ds 42
+	db @
--- /dev/null
+++ b/test/asm/pc.out
@@ -1,0 +1,2 @@
+$1A4
+$1E9
binary files /dev/null b/test/asm/pc.out.bin differ