aboutsummaryrefslogtreecommitdiffstats
path: root/travis
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-08-27 11:43:08 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-08-27 11:43:08 -0700
commit2b4886afdd60106bac617408201e3d5160181dc6 (patch)
tree82a9faf673c5a7dbcbd5cdf5af2d97679a419861 /travis
parent0b7244fcd6ec913e3cd5df03a07ba39e326e15ce (diff)
downloadnasm-2b4886afdd60106bac617408201e3d5160181dc6.tar.gz
nasm-2b4886afdd60106bac617408201e3d5160181dc6.tar.xz
nasm-2b4886afdd60106bac617408201e3d5160181dc6.zip
BR 3392715: fix %ifid with $ and $$
%ifid $ and %ifid $$ has traditionally been false, revert to that behavior. Reported-by: Mike Hommey <mh+anfz@glandium.org> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'travis')
-rw-r--r--travis/test/ifid.asm19
-rw-r--r--travis/test/ifid.bin.t3
-rw-r--r--travis/test/ifid.json11
3 files changed, 33 insertions, 0 deletions
diff --git a/travis/test/ifid.asm b/travis/test/ifid.asm
new file mode 100644
index 00000000..ffe03d27
--- /dev/null
+++ b/travis/test/ifid.asm
@@ -0,0 +1,19 @@
+; BR 3392715: Test proper operation of %ifid with $ and $$
+; This produces a human-readable file when compiled with -f bin
+
+%define LF 10
+
+%macro ifid 2
+ %ifid %1
+ %define %%is 'true'
+ %else
+ %define %%is 'false'
+ %endif
+ %defstr %%what %1
+ %defstr %%should %2
+ db '%ifid ', %%what, ' = ', %%is, ' (expect ', %%should, ')', LF
+%endmacro
+
+ ifid hello, true
+ ifid $, false
+ ifid $$, false
diff --git a/travis/test/ifid.bin.t b/travis/test/ifid.bin.t
new file mode 100644
index 00000000..ca86592d
--- /dev/null
+++ b/travis/test/ifid.bin.t
@@ -0,0 +1,3 @@
+%ifid hello = true (expect true)
+%ifid $ = false (expect false)
+%ifid $$ = false (expect false)
diff --git a/travis/test/ifid.json b/travis/test/ifid.json
new file mode 100644
index 00000000..cf1a3854
--- /dev/null
+++ b/travis/test/ifid.json
@@ -0,0 +1,11 @@
+[
+ {
+ "description": "BR 3392715: Test proper operation of %ifid with $ and $$",
+ "id": "ifid",
+ "format": "bin",
+ "source": "ifid.asm",
+ "target": [
+ { "output": "ifid.bin" }
+ ]
+ }
+]