open-simh.simtools/tests/test-gbl.lst.ok
Olaf Seibert 652c047711 Better error message for .globl 1$
Local labels can't be exported (or imported).
2021-05-30 13:19:39 +02:00

33 lines
1.7 KiB
Plaintext

1 ;;;;
2 ;
3 ; Test that .dsabl gbl at the end of the source does not carry
4 ; over to the beginning of the next pass.
5 ; This is actually guaranteed automatically, since it is used in pass 1 only.
6 ; The symbol should however be entered into the symbol table as UNKNOWN.
7 ;
8
9 000000 012700 000000G mov #lab1,r0 ; ok: implicitly global (imported)
10 .dsabl gbl
test-gbl.mac:11: ***ERROR Invalid expression (complex relocation)
11 000004 012700 000000 mov #lab2,r0 ; error: undefined
12
test-gbl.mac:13: ***ERROR Local label used in .GLOBL/.WEAK
13 .globl 1$ ; error: locals can't be globals too
test-gbl.mac:14: ***ERROR Local label used in .GLOBL/.WEAK
14 .globl 2$ ; error: locals can't be globals too
15 000010 012700 000010' 1$: mov #1$,r0
16
17 .end
17
Symbol table
. 000014R 001 1$0 000010R L 001 LAB1 = ****** GX LAB2 = ******
Program sections:
. ABS. 000000 000 (RW,I,GBL,ABS,OVR,NOSAV)
000014 001 (RW,I,LCL,REL,CON,NOSAV)