summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-04-07 21:59:24 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-04-07 21:59:24 -0700
commit9bb46df4b716c5d8c483e66d39d2edb3ceb161f0 (patch)
tree3692eb5836c0b99b78954aec41c9811d754cc22d /test
parent1582d52863ee6f857c1c76e2abe9a413f278e648 (diff)
downloadnasm-9bb46df4b716c5d8c483e66d39d2edb3ceb161f0.tar.gz
nasm-9bb46df4b716c5d8c483e66d39d2edb3ceb161f0.tar.bz2
nasm-9bb46df4b716c5d8c483e66d39d2edb3ceb161f0.zip
Handle weird cases of token pasting
Especially when token pasting involves floating-point numbers, we can have some really strange effects from token pasting: for example, pasting the two tokens "xyzzy" and "1e+10" ends up with *three* tokens: "xyzzy1e" "+" "10". The easiest way to deal with this is to explicitly combine the string and then run tokenize() on it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test')
-rw-r--r--test/weirdpaste.asm14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/weirdpaste.asm b/test/weirdpaste.asm
new file mode 100644
index 0000000..c6e9815
--- /dev/null
+++ b/test/weirdpaste.asm
@@ -0,0 +1,14 @@
+;Testname=preproc; Arguments=-E; Files=stdout stderr
+;Testname=bin; Arguments=-fbin -oweirdpaste.bin; Files=stdout stderr weirdpaste.bin
+
+ %define foo xyzzy
+%define bar 1e+10
+
+%define xyzzy1e 15
+
+%macro dx 2
+%assign xx %1%2
+ dw xx
+%endmacro
+
+ dx foo, bar