summaryrefslogtreecommitdiff
path: root/test/ifenv.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-07-20 14:56:30 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-20 14:56:30 -0700
commit077fb93d2bfaf2d4acb356535026efe56c0e120e (patch)
tree61dc56c351f7bac2aea5dd016943b81f335d09d1 /test/ifenv.asm
parentaed4eaa8f3d83880a98592937ca6eb8114550a33 (diff)
downloadnasm-077fb93d2bfaf2d4acb356535026efe56c0e120e.tar.gz
preproc: allow non-identifier character in environment variables
Allow non-identifier characters in the name of environment variables, by surrounding them with string quotes (subject to ordinary string-quoting rules.) Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'test/ifenv.asm')
-rw-r--r--test/ifenv.asm31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/ifenv.asm b/test/ifenv.asm
new file mode 100644
index 00000000..15f12f88
--- /dev/null
+++ b/test/ifenv.asm
@@ -0,0 +1,31 @@
+%macro import 1
+ %defstr %%incfile %!PROJECTBASEDIR/%{1}.inc
+ %defstr %%decfile %!'PROJECTBASEDIR'/%{1}.dec
+ db %%incfile, `\n`
+ db %%decfile, `\n`
+%endmacro
+
+%ifenv PROJECTBASEDIR
+import foo
+%else
+%warning No PROJECTBASEDIR defined
+%endif
+
+%ifenv %!PROJECTBASEDIR
+import foo
+%else
+%warning No PROJECTBASEDIR defined
+%endif
+
+%ifenv 'PROJECTBASEDIR'
+import foo
+%else
+%warning No PROJECTBASEDIR defined
+%endif
+
+%ifenv %!'PROJECTBASEDIR'
+import foo
+%else
+%warning No PROJECTBASEDIR defined
+%endif
+