test: add test for context-local labels and extern label promotion

Add a simple test case for context-local (%$) labels not disturbing
the local variable namespace, and extern labels getting promoted to
global.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin, Intel 2018-06-25 13:19:32 -07:00
parent c5e45f6b70
commit 59242bd10a

25
test/ctxlocal.asm Normal file
View file

@ -0,0 +1,25 @@
;;
;; Test of context-local labels
;;
bits 64
extern everywhere ; Test of extern -> global promotion, too
extern tjosan
here:
jz .there
%push foo
jo %$mordor
hlt
%$mordor:
nop
%pop
.there:
ret
everywhere:
ret
global everywhere
tjosan:
ret