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:
parent
c5e45f6b70
commit
59242bd10a
1 changed files with 25 additions and 0 deletions
25
test/ctxlocal.asm
Normal file
25
test/ctxlocal.asm
Normal 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
|
Loading…
Reference in a new issue