From 59242bd10aa8dd3087c31b10a39f94ef0aa3986e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin, Intel" Date: Mon, 25 Jun 2018 13:19:32 -0700 Subject: [PATCH] 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) --- test/ctxlocal.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/ctxlocal.asm 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