summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin, Intel <h.peter.anvin@intel.com>2018-06-25 13:19:32 -0700
committerH. Peter Anvin, Intel <h.peter.anvin@intel.com>2018-06-25 13:19:32 -0700
commit59242bd10aa8dd3087c31b10a39f94ef0aa3986e (patch)
tree3a3e80e44dde84f6fcc0dcb5fe93f6df8bf5db61
parentc5e45f6b7081c6dd5959d48327c2a9828b65315d (diff)
downloadnasm-59242bd10aa8dd3087c31b10a39f94ef0aa3986e.tar.gz
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>
-rw-r--r--test/ctxlocal.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ctxlocal.asm b/test/ctxlocal.asm
new file mode 100644
index 00000000..93e9fcae
--- /dev/null
+++ b/test/ctxlocal.asm
@@ -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