From 794ebd7a0bc10b863e6d764df63cc49a5976b64a Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sat, 18 Jun 2022 21:04:36 +0200 Subject: [PATCH] Test cases for .assert warnings --- test/asm/listing/030-assert-success.bin-ref | 1 + test/asm/listing/030-assert-success.err-ref | 20 +++++ .../listing/030-assert-success.ld65err-ref | 40 +++++++++ test/asm/listing/030-assert-success.s | 81 +++++++++++++++++++ test/asm/listing/Makefile | 17 +++- 5 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 test/asm/listing/030-assert-success.bin-ref create mode 100644 test/asm/listing/030-assert-success.err-ref create mode 100644 test/asm/listing/030-assert-success.ld65err-ref create mode 100644 test/asm/listing/030-assert-success.s diff --git a/test/asm/listing/030-assert-success.bin-ref b/test/asm/listing/030-assert-success.bin-ref new file mode 100644 index 000000000..685e809a7 --- /dev/null +++ b/test/asm/listing/030-assert-success.bin-ref @@ -0,0 +1 @@ +κκ \ No newline at end of file diff --git a/test/asm/listing/030-assert-success.err-ref b/test/asm/listing/030-assert-success.err-ref new file mode 100644 index 000000000..e36a9e6bc --- /dev/null +++ b/test/asm/listing/030-assert-success.err-ref @@ -0,0 +1,20 @@ +030-assert-success.s:45: Warning: Code not at $0000 +030-assert-success.s:46: Warning: Code not at $0000 +030-assert-success.s:48: Warning: Code not at $0001 +030-assert-success.s:49: Warning: Code not at $0001 +030-assert-success.s:51: Warning: Code not at $1000 +030-assert-success.s:52: Warning: Code not at $1000 +030-assert-success.s:54: Warning: Code not at $1001 +030-assert-success.s:55: Warning: Code not at $1001 +030-assert-success.s:60: Warning: Code not at $8001 +030-assert-success.s:61: Warning: Code not at $8001 +030-assert-success.s:65: Warning: Code not at $0000 +030-assert-success.s:66: Warning: Code not at $0000 +030-assert-success.s:68: Warning: Code not at $0001 +030-assert-success.s:69: Warning: Code not at $0001 +030-assert-success.s:71: Warning: Code not at $1000 +030-assert-success.s:72: Warning: Code not at $1000 +030-assert-success.s:74: Warning: Code not at $1001 +030-assert-success.s:75: Warning: Code not at $1001 +030-assert-success.s:77: Warning: Code not at $8000 +030-assert-success.s:78: Warning: Code not at $8000 diff --git a/test/asm/listing/030-assert-success.ld65err-ref b/test/asm/listing/030-assert-success.ld65err-ref new file mode 100644 index 000000000..2f099f95f --- /dev/null +++ b/test/asm/listing/030-assert-success.ld65err-ref @@ -0,0 +1,40 @@ +ld65: Warning: 030-assert-success.s:3: Code not at $0000 +ld65: Warning: 030-assert-success.s:4: Code not at $0000 +ld65: Warning: 030-assert-success.s:6: Code not at $0001 +ld65: Warning: 030-assert-success.s:7: Code not at $0001 +ld65: Warning: 030-assert-success.s:12: Code not at $1001 +ld65: Warning: 030-assert-success.s:13: Code not at $1001 +ld65: Warning: 030-assert-success.s:15: Code not at $8000 +ld65: Warning: 030-assert-success.s:16: Code not at $8000 +ld65: Warning: 030-assert-success.s:18: Code not at $8001 +ld65: Warning: 030-assert-success.s:19: Code not at $8001 +ld65: Warning: 030-assert-success.s:23: Code not at $0000 +ld65: Warning: 030-assert-success.s:24: Code not at $0000 +ld65: Warning: 030-assert-success.s:26: Code not at $0001 +ld65: Warning: 030-assert-success.s:27: Code not at $0001 +ld65: Warning: 030-assert-success.s:29: Code not at $1000 +ld65: Warning: 030-assert-success.s:30: Code not at $1000 +ld65: Warning: 030-assert-success.s:35: Code not at $8000 +ld65: Warning: 030-assert-success.s:36: Code not at $8000 +ld65: Warning: 030-assert-success.s:38: Code not at $8001 +ld65: Warning: 030-assert-success.s:39: Code not at $8001 +ld65: Warning: 030-assert-success.s:45: Code not at $0000 +ld65: Warning: 030-assert-success.s:46: Code not at $0000 +ld65: Warning: 030-assert-success.s:48: Code not at $0001 +ld65: Warning: 030-assert-success.s:49: Code not at $0001 +ld65: Warning: 030-assert-success.s:51: Code not at $1000 +ld65: Warning: 030-assert-success.s:52: Code not at $1000 +ld65: Warning: 030-assert-success.s:54: Code not at $1001 +ld65: Warning: 030-assert-success.s:55: Code not at $1001 +ld65: Warning: 030-assert-success.s:60: Code not at $8001 +ld65: Warning: 030-assert-success.s:61: Code not at $8001 +ld65: Warning: 030-assert-success.s:65: Code not at $0000 +ld65: Warning: 030-assert-success.s:66: Code not at $0000 +ld65: Warning: 030-assert-success.s:68: Code not at $0001 +ld65: Warning: 030-assert-success.s:69: Code not at $0001 +ld65: Warning: 030-assert-success.s:71: Code not at $1000 +ld65: Warning: 030-assert-success.s:72: Code not at $1000 +ld65: Warning: 030-assert-success.s:74: Code not at $1001 +ld65: Warning: 030-assert-success.s:75: Code not at $1001 +ld65: Warning: 030-assert-success.s:77: Code not at $8000 +ld65: Warning: 030-assert-success.s:78: Code not at $8000 diff --git a/test/asm/listing/030-assert-success.s b/test/asm/listing/030-assert-success.s new file mode 100644 index 000000000..17abcb22f --- /dev/null +++ b/test/asm/listing/030-assert-success.s @@ -0,0 +1,81 @@ +; 2022-06-15 Spiro Trikaliotis + + .ASSERT * = $0000, warning, "Code not at $0000" + .assert * = $0000, warning, "Code not at $0000" + + .ASSERT * = $0001, warning, "Code not at $0001" + .assert * = $0001, warning, "Code not at $0001" + + .ASSERT * = $1000, warning, "Code not at $1000" + .assert * = $1000, warning, "Code not at $1000" + + .ASSERT * = $1001, warning, "Code not at $1001" + .assert * = $1001, warning, "Code not at $1001" + + .ASSERT * = $8000, warning, "Code not at $8000" + .assert * = $8000, warning, "Code not at $8000" + + .ASSERT * = $8001, warning, "Code not at $8001" + .assert * = $8001, warning, "Code not at $8001" + + nop + + .ASSERT * = $0000, warning, "Code not at $0000" + .assert * = $0000, warning, "Code not at $0000" + + .ASSERT * = $0001, warning, "Code not at $0001" + .assert * = $0001, warning, "Code not at $0001" + + .ASSERT * = $1000, warning, "Code not at $1000" + .assert * = $1000, warning, "Code not at $1000" + + .ASSERT * = $1001, warning, "Code not at $1001" + .assert * = $1001, warning, "Code not at $1001" + + .ASSERT * = $8000, warning, "Code not at $8000" + .assert * = $8000, warning, "Code not at $8000" + + .ASSERT * = $8001, warning, "Code not at $8001" + .assert * = $8001, warning, "Code not at $8001" + + + + .org $8000 + + .ASSERT * = $0000, warning, "Code not at $0000" + .assert * = $0000, warning, "Code not at $0000" + + .ASSERT * = $0001, warning, "Code not at $0001" + .assert * = $0001, warning, "Code not at $0001" + + .ASSERT * = $1000, warning, "Code not at $1000" + .assert * = $1000, warning, "Code not at $1000" + + .ASSERT * = $1001, warning, "Code not at $1001" + .assert * = $1001, warning, "Code not at $1001" + + .ASSERT * = $8000, warning, "Code not at $8000" + .assert * = $8000, warning, "Code not at $8000" + + .ASSERT * = $8001, warning, "Code not at $8001" + .assert * = $8001, warning, "Code not at $8001" + + nop + + .ASSERT * = $0000, warning, "Code not at $0000" + .assert * = $0000, warning, "Code not at $0000" + + .ASSERT * = $0001, warning, "Code not at $0001" + .assert * = $0001, warning, "Code not at $0001" + + .ASSERT * = $1000, warning, "Code not at $1000" + .assert * = $1000, warning, "Code not at $1000" + + .ASSERT * = $1001, warning, "Code not at $1001" + .assert * = $1001, warning, "Code not at $1001" + + .ASSERT * = $8000, warning, "Code not at $8000" + .assert * = $8000, warning, "Code not at $8000" + + .ASSERT * = $8001, warning, "Code not at $8001" + .assert * = $8001, warning, "Code not at $8001" diff --git a/test/asm/listing/Makefile b/test/asm/listing/Makefile index 8eed4e409..6889a84dd 100644 --- a/test/asm/listing/Makefile +++ b/test/asm/listing/Makefile @@ -43,9 +43,12 @@ $(ISEQUAL): ../../isequal.c | $(WORKDIR) $(CC) $(CFLAGS) -o $@ $< +$(WORKDIR)/_empty: + touch $@ + define LISTING_template -$(WORKDIR)/$1.bin: $1.s $(ISEQUAL) +$(WORKDIR)/$1.bin: $1.s $(ISEQUAL) $(WORKDIR)/_empty $(if $(QUIET),echo asm/$1.bin) # compile without generating listing @@ -54,6 +57,8 @@ $(WORKDIR)/$1.bin: $1.s $(ISEQUAL) ifneq ($(wildcard $1.err-ref),) $(ISEQUAL) $1.err-ref $$(@:.bin=.err) +else + $(ISEQUAL) $(WORKDIR)/_empty $$(@:.bin=.err) endif ifneq ($(wildcard $1.bin-ref),) @@ -61,10 +66,18 @@ ifneq ($(wildcard $1.bin-ref),) endif $(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1 - $(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib + $(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.ld65-err) 2>&1 ifneq ($(wildcard $1.err-ref),) $(ISEQUAL) $1.err-ref $$(@:.bin=.list-err) +else + $(ISEQUAL) $(WORKDIR)/_empty $$(@:.bin=.list-err) +endif + +ifneq ($(wildcard $1.ld65err-ref),) + $(ISEQUAL) $1.ld65err-ref $$(@:.bin=.ld65-err) +else + $(ISEQUAL) $(WORKDIR)/_empty $$(@:.bin=.ld65-err) endif # check if the result bin is the same as without listing file