More tests. Refine string delimiter test for .ASCII a bit.

Make the delimiters for .INCLUDE and .LIBRARY accept the same
delimiters (= is not disallowed, it just makes the line look like
an assignment).
This commit is contained in:
Olaf Seibert 2015-06-04 12:11:14 +02:00
parent fdceabe88c
commit 137a9db671
5 changed files with 30 additions and 7 deletions

View File

@ -83,6 +83,9 @@ char *getstring(
* but not
* .include ^/name/ <name> name =name= :name:
* .include :name: seems to be silently ignored.
*
* This should probably follow the exact same rules as .ASCII
* although that is not mentioned in the manual,
*/
char *getstring_fn(
char *cp,
@ -94,7 +97,6 @@ char *getstring_fn(
switch (*cp) {
case '<':
case '=':
case ':':
return NULL;
}

View File

@ -16,6 +16,7 @@ TESTS="test-asciz \
test-jmp \
test-locals \
test-macro-comma \
test-psect \
test-undef \
test-word-comma"

View File

@ -6,7 +6,15 @@ CR = 13.
LF = 10.
SOH = 1
.asciz <cr><lf>/<SOH>/ ; 2 bytes and a string
.asciz /<cr><lf><SOH>/ ; only a string
.asciz |<cr><lf><SOH>| ; the same string
.asciz <cr><lf><SOH> ; 3 bytes
.asciz <cr><lf>/<SOH>/ ; 2 bytes and a string
.asciz /<cr><lf><SOH>/ ; only a string
.asciz |<cr><lf><SOH>| ; the same string
.ascii <cr><lf><SOH> ; 3 bytes
.asciz ;ABC;/DEF/ ; ABCDEF, not recommended practice
.asciz /ABC/;DEF; ; ABC, not recommended practice
.asciz /ABC/=DEF= ; ABCDEF, not recommended practice
.asciz =DEF= ; syntax error: assignment
.asciz =###= ; syntax error: assignment
.asciz :SOH: ; syntax error: colon not allowed
.asciz :###: ; syntax error: colon not allowed

View File

@ -13,5 +13,5 @@
.include <incl.mac>
.include <incl.mac<
.include =incl.mac=
.include :incl.mac:
.include =incl.mac= ; looks like assignment
.include :incl.mac: ; looks like a label

12
tests/test-psect.mac Normal file
View File

@ -0,0 +1,12 @@
;;;;;
;
; Contrary to what the manual says, flags in .PSECT directives
; are merged. They do not need to be identical every time.
;
.psect $pdata
.iif P1, .psect $pdata ,ro,d,lcl,rel,con
.psect $PDATA ,D
; and ends up with
; $PDATA 000000 002 (RO,D,LCL,REL,CON)