shithub: rgbds

Download patch

ref: 818a0d029622d7b38228b948c422dffb3a92c552
parent: ab1eb146c925498d3aaf31112dd5bd590032b794
author: ISSOtm <eldredhabert0@gmail.com>
date: Fri Feb 7 09:53:28 EST 2020

Test more cases in `label-diff` test

--- a/test/asm/label-diff.asm
+++ b/test/asm/label-diff.asm
@@ -31,11 +31,11 @@
 	; Diffing two labels in the same SECTION as well
 	print_diff Known2, Known
 	; Diffing a constant and a "floating" label cannot work
-; ...And that causes a fatal error	print_diff Constant, Known
+	print_diff Constant, Known
 	; Diffing a constant and a ref cannot work
-; ...And that causes a fatal error	print_diff Constant, Unknown
+	print_diff Constant, Unknown
 	; Diffing a floating label and a ref cannot work
-; ...And that causes a fatal error	print_diff Known, Unknown
+	print_diff Known, Unknown
 
 	; Now let's fiddle with PC
 SECTION "fixed PC", ROM0[420]
@@ -42,9 +42,9 @@
 	; Diffing a constant and PC should work
 	print_diff Constant, @
 	; Diffing a floating label and PC cannot work
-; ...And that causes a fatal error	print_diff Known, @
+	print_diff Known, @
 	; Diffinf a ref and PC cannot work
-; ...And that causes a fatal error	print_diff Unknown, @
+	print_diff Unknown, @
 	; Diffing PC and PC should work
 	print_diff @, @
 	; Diffing PC and a label from here should work
@@ -53,11 +53,11 @@
 
 SECTION "Floating PC", ROM0
 	; Diffing a constant and PC cannot work
-; ...And that causes a fatal error	print_diff Constant, @
+	print_diff Constant, @
 	; Diffing a floating label and PC cannot work
-; ...And that causes a fatal error	print_diff Known, @
+	print_diff Known, @
 	; Diffinf a ref and PC cannot work
-; ...And that causes a fatal error	print_diff Unknown, @
+	print_diff Unknown, @
 	; Diffing PC and PC should work
 	print_diff @, @
 	; Diffing PC and a label from here should work
--- a/test/asm/label-diff.err
+++ b/test/asm/label-diff.err
@@ -1,0 +1,33 @@
+ERROR: label-diff.asm(34) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Known' is not constant at assembly time
+ERROR: label-diff.asm(34) -> label-diff.asm::print_diff(22):
+    Expected constant expression: 'Known' is not constant at assembly time
+ERROR: label-diff.asm(36) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(36) -> label-diff.asm::print_diff(22):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(38) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Known' is not constant at assembly time
+ERROR: label-diff.asm(38) -> label-diff.asm::print_diff(22):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(45) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Known' is not constant at assembly time
+ERROR: label-diff.asm(45) -> label-diff.asm::print_diff(22):
+    Expected constant expression: 'Known' is not constant at assembly time
+ERROR: label-diff.asm(47) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(47) -> label-diff.asm::print_diff(22):
+    Expected constant expression: 'Unknown' is not constant at assembly time
+ERROR: label-diff.asm(56) -> label-diff.asm::print_diff(20):
+    Expected constant expression: PC is not constant at assembly time
+ERROR: label-diff.asm(56) -> label-diff.asm::print_diff(22):
+    Expected constant expression: PC is not constant at assembly time
+ERROR: label-diff.asm(58) -> label-diff.asm::print_diff(20):
+    Expected constant expression: 'Known' 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: 'Unknown' 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: Assembly aborted (16 errors)!
--- a/test/asm/label-diff.out
+++ b/test/asm/label-diff.out
@@ -2,8 +2,24 @@
 $1B
 $4
 $FFFFFFFC
+$0
+$0
+$0
+$0
+$0
+$0
 $FFFFFE86
 $17A
+$0
+$0
+$0
+$0
+$0
+$0
+$0
+$0
+$0
+$0
 $0
 $0
 $0