aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-07-07 23:51:17 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-07-07 23:51:17 +0200
commit5fca76b56034554d965b77d1485f92685d79bc84 (patch)
tree425aee9ff95f2d41974b1e7d06df201f4263b5cd /tests
parent2b1356d371b52d68243ddebbfcf3f65047c2fd76 (diff)
downloadtools.nes-5fca76b56034554d965b77d1485f92685d79bc84.tar.gz
tools.nes-5fca76b56034554d965b77d1485f92685d79bc84.zip
Let arguments be able to reference their macro
The enum type for macro arguments has been adjusted so it accepts a String. This is then used to store the name of the macro for this argument. This is a bit of a circlejerk, but in the end it stems from the fact that macro arguments were sort of a hack defined ad-hoc each time they were needed. That being said, if we want to report macro arguments being unused, we need to reference the actual macro definition, not the macro call. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/expected/unused-warning.txt4
-rw-r--r--tests/expected/unused_macro_arg.txt1
-rw-r--r--tests/unused_macro_arg.s4
3 files changed, 5 insertions, 4 deletions
diff --git a/tests/expected/unused-warning.txt b/tests/expected/unused-warning.txt
index 2917e2e..4d49cca 100644
--- a/tests/expected/unused-warning.txt
+++ b/tests/expected/unused-warning.txt
@@ -1,3 +1,3 @@
+warning: argument 'UNUSED_ARG' of the macro 'USED_MACRO' is unused (unused.s: line 12)
warning: macro 'UNUSED_MACRO' is unused (unused.s)
-warning: macro argument 'UNUSED_ARG' is unused (unused.s)
-warning: variable 'zp_unused' is unused (unused.s)
+warning: variable 'zp_unused' is unused (unused.s: line 24)
diff --git a/tests/expected/unused_macro_arg.txt b/tests/expected/unused_macro_arg.txt
index e69de29..7ca122a 100644
--- a/tests/expected/unused_macro_arg.txt
+++ b/tests/expected/unused_macro_arg.txt
@@ -0,0 +1 @@
+warning: argument 'OTHER' of the macro 'BCD_ADD' is unused (unused_macro_arg.s: line 11)
diff --git a/tests/unused_macro_arg.s b/tests/unused_macro_arg.s
index fe4d7f0..ef75a23 100644
--- a/tests/unused_macro_arg.s
+++ b/tests/unused_macro_arg.s
@@ -8,7 +8,7 @@
;;; asan:stack full
-.macro BCD_ADD ADDR
+.macro BCD_ADD ADDR, OTHER
adc ADDR
bcc :+
nop
@@ -16,7 +16,7 @@
.endmacro
.proc add_to_player_y
- BCD_ADD additions
+ BCD_ADD additions, 2
rts