aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2020-10-15 22:01:21 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2020-10-15 22:01:21 +0300
commit8ff5cecc2989aedadf439481254fc22d80133726 (patch)
tree076745c2ff76acd7e2127cdf363efcbb1183fa58
parentdaa534e55cfc7d907ecfff91ab3bb6c1cc0eea55 (diff)
downloadnasm-8ff5cecc2989aedadf439481254fc22d80133726.tar.gz
nasm-8ff5cecc2989aedadf439481254fc22d80133726.tar.xz
nasm-8ff5cecc2989aedadf439481254fc22d80133726.zip
travis: add ilog
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--travis/test/ilog-error.stderr25
-rw-r--r--travis/test/ilog.asm271
-rw-r--r--travis/test/ilog.bin.tbin0 -> 226 bytes
-rw-r--r--travis/test/ilog.json22
-rw-r--r--travis/test/ilog.stderr25
5 files changed, 343 insertions, 0 deletions
diff --git a/travis/test/ilog-error.stderr b/travis/test/ilog-error.stderr
new file mode 100644
index 00000000..cac46820
--- /dev/null
+++ b/travis/test/ilog-error.stderr
@@ -0,0 +1,25 @@
+./travis/test/ilog.asm:136: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:137: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:138: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:139: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:141: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:142: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:143: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:145: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:146: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:147: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:149: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:150: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:151: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:153: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:154: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:155: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:157: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:158: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:159: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:161: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:162: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:163: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:165: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:166: error: ilog2 argument is not a power of two
+./travis/test/ilog.asm:167: error: ilog2 argument is not a power of two
diff --git a/travis/test/ilog.asm b/travis/test/ilog.asm
new file mode 100644
index 00000000..2796af80
--- /dev/null
+++ b/travis/test/ilog.asm
@@ -0,0 +1,271 @@
+%use ifunc
+
+ db ilog2(0x1)
+ db ilog2(0x2)
+ db ilog2(0x4)
+ db ilog2(0x8)
+ db ilog2(0x10)
+ db ilog2(0x20)
+ db ilog2(0x40)
+ db ilog2(0x80)
+ db ilog2(0x100)
+ db ilog2(0x200)
+ db ilog2(0x400)
+ db ilog2(0x800)
+ db ilog2(0x1000)
+ db ilog2(0x2000)
+ db ilog2(0x4000)
+ db ilog2(0x8000)
+ db ilog2(0x10000)
+ db ilog2(0x20000)
+ db ilog2(0x40000)
+ db ilog2(0x80000)
+ db ilog2(0x100000)
+ db ilog2(0x200000)
+ db ilog2(0x400000)
+ db ilog2(0x800000)
+ db ilog2(0x1000000)
+ db ilog2(0x2000000)
+ db ilog2(0x4000000)
+ db ilog2(0x8000000)
+ db ilog2(0x10000000)
+ db ilog2(0x20000000)
+ db ilog2(0x40000000)
+ db ilog2(0x80000000)
+
+ db ilog2w(0x1)
+ db ilog2w(0x2)
+ db ilog2w(0x4)
+ db ilog2w(0x8)
+ db ilog2w(0x10)
+ db ilog2w(0x20)
+ db ilog2w(0x40)
+ db ilog2w(0x80)
+ db ilog2w(0x100)
+ db ilog2w(0x200)
+ db ilog2w(0x400)
+ db ilog2w(0x800)
+ db ilog2w(0x1000)
+ db ilog2w(0x2000)
+ db ilog2w(0x4000)
+ db ilog2w(0x8000)
+ db ilog2w(0x10000)
+ db ilog2w(0x20000)
+ db ilog2w(0x40000)
+ db ilog2w(0x80000)
+ db ilog2w(0x100000)
+ db ilog2w(0x200000)
+ db ilog2w(0x400000)
+ db ilog2w(0x800000)
+ db ilog2w(0x1000000)
+ db ilog2w(0x2000000)
+ db ilog2w(0x4000000)
+ db ilog2w(0x8000000)
+ db ilog2w(0x10000000)
+ db ilog2w(0x20000000)
+ db ilog2w(0x40000000)
+ db ilog2w(0x80000000)
+
+ db ilog2f(0x1)
+ db ilog2f(0x2)
+ db ilog2f(0x4)
+ db ilog2f(0x8)
+ db ilog2f(0x10)
+ db ilog2f(0x20)
+ db ilog2f(0x40)
+ db ilog2f(0x80)
+ db ilog2f(0x100)
+ db ilog2f(0x200)
+ db ilog2f(0x400)
+ db ilog2f(0x800)
+ db ilog2f(0x1000)
+ db ilog2f(0x2000)
+ db ilog2f(0x4000)
+ db ilog2f(0x8000)
+ db ilog2f(0x10000)
+ db ilog2f(0x20000)
+ db ilog2f(0x40000)
+ db ilog2f(0x80000)
+ db ilog2f(0x100000)
+ db ilog2f(0x200000)
+ db ilog2f(0x400000)
+ db ilog2f(0x800000)
+ db ilog2f(0x1000000)
+ db ilog2f(0x2000000)
+ db ilog2f(0x4000000)
+ db ilog2f(0x8000000)
+ db ilog2f(0x10000000)
+ db ilog2f(0x20000000)
+ db ilog2f(0x40000000)
+ db ilog2f(0x80000000)
+
+ db ilog2c(0x1)
+ db ilog2c(0x2)
+ db ilog2c(0x4)
+ db ilog2c(0x8)
+ db ilog2c(0x10)
+ db ilog2c(0x20)
+ db ilog2c(0x40)
+ db ilog2c(0x80)
+ db ilog2c(0x100)
+ db ilog2c(0x200)
+ db ilog2c(0x400)
+ db ilog2c(0x800)
+ db ilog2c(0x1000)
+ db ilog2c(0x2000)
+ db ilog2c(0x4000)
+ db ilog2c(0x8000)
+ db ilog2c(0x10000)
+ db ilog2c(0x20000)
+ db ilog2c(0x40000)
+ db ilog2c(0x80000)
+ db ilog2c(0x100000)
+ db ilog2c(0x200000)
+ db ilog2c(0x400000)
+ db ilog2c(0x800000)
+ db ilog2c(0x1000000)
+ db ilog2c(0x2000000)
+ db ilog2c(0x4000000)
+ db ilog2c(0x8000000)
+ db ilog2c(0x10000000)
+ db ilog2c(0x20000000)
+ db ilog2c(0x40000000)
+ db ilog2c(0x80000000)
+
+%ifdef ERROR
+ db ilog2(0x0)
+ db ilog2(0x3)
+ db ilog2(0x5)
+ db ilog2(0x9)
+ db ilog2(0x10)
+ db ilog2(0x30)
+ db ilog2(0x50)
+ db ilog2(0x90)
+ db ilog2(0x100)
+ db ilog2(0x300)
+ db ilog2(0x500)
+ db ilog2(0x900)
+ db ilog2(0x1000)
+ db ilog2(0x3000)
+ db ilog2(0x5000)
+ db ilog2(0x9000)
+ db ilog2(0x10000)
+ db ilog2(0x30000)
+ db ilog2(0x50000)
+ db ilog2(0x90000)
+ db ilog2(0x100000)
+ db ilog2(0x300000)
+ db ilog2(0x500000)
+ db ilog2(0x900000)
+ db ilog2(0x1000000)
+ db ilog2(0x3000000)
+ db ilog2(0x5000000)
+ db ilog2(0x9000000)
+ db ilog2(0x10000000)
+ db ilog2(0x30000000)
+ db ilog2(0x50000000)
+ db ilog2(0x90000000)
+%endif
+
+%ifdef WARNING
+ db ilog2w(0x0)
+ db ilog2w(0x3)
+ db ilog2w(0x5)
+ db ilog2w(0x9)
+ db ilog2w(0x10)
+ db ilog2w(0x30)
+ db ilog2w(0x50)
+ db ilog2w(0x90)
+ db ilog2w(0x100)
+ db ilog2w(0x300)
+ db ilog2w(0x500)
+ db ilog2w(0x900)
+ db ilog2w(0x1000)
+ db ilog2w(0x3000)
+ db ilog2w(0x5000)
+ db ilog2w(0x9000)
+ db ilog2w(0x10000)
+ db ilog2w(0x30000)
+ db ilog2w(0x50000)
+ db ilog2w(0x90000)
+ db ilog2w(0x100000)
+ db ilog2w(0x300000)
+ db ilog2w(0x500000)
+ db ilog2w(0x900000)
+ db ilog2w(0x1000000)
+ db ilog2w(0x3000000)
+ db ilog2w(0x5000000)
+ db ilog2w(0x9000000)
+ db ilog2w(0x10000000)
+ db ilog2w(0x30000000)
+ db ilog2w(0x50000000)
+ db ilog2w(0x90000000)
+%endif
+
+ db ilog2f(0x0)
+ db ilog2f(0x1)
+ db ilog2f(0x3)
+ db ilog2f(0x5)
+ db ilog2f(0x9)
+ db ilog2f(0x10)
+ db ilog2f(0x30)
+ db ilog2f(0x50)
+ db ilog2f(0x90)
+ db ilog2f(0x100)
+ db ilog2f(0x300)
+ db ilog2f(0x500)
+ db ilog2f(0x900)
+ db ilog2f(0x1000)
+ db ilog2f(0x3000)
+ db ilog2f(0x5000)
+ db ilog2f(0x9000)
+ db ilog2f(0x10000)
+ db ilog2f(0x30000)
+ db ilog2f(0x50000)
+ db ilog2f(0x90000)
+ db ilog2f(0x100000)
+ db ilog2f(0x300000)
+ db ilog2f(0x500000)
+ db ilog2f(0x900000)
+ db ilog2f(0x1000000)
+ db ilog2f(0x3000000)
+ db ilog2f(0x5000000)
+ db ilog2f(0x9000000)
+ db ilog2f(0x10000000)
+ db ilog2f(0x30000000)
+ db ilog2f(0x50000000)
+ db ilog2f(0x90000000)
+
+ db ilog2c(0x0)
+ db ilog2c(0x1)
+ db ilog2c(0x3)
+ db ilog2c(0x5)
+ db ilog2c(0x9)
+ db ilog2c(0x10)
+ db ilog2c(0x30)
+ db ilog2c(0x50)
+ db ilog2c(0x90)
+ db ilog2c(0x100)
+ db ilog2c(0x300)
+ db ilog2c(0x500)
+ db ilog2c(0x900)
+ db ilog2c(0x1000)
+ db ilog2c(0x3000)
+ db ilog2c(0x5000)
+ db ilog2c(0x9000)
+ db ilog2c(0x10000)
+ db ilog2c(0x30000)
+ db ilog2c(0x50000)
+ db ilog2c(0x90000)
+ db ilog2c(0x100000)
+ db ilog2c(0x300000)
+ db ilog2c(0x500000)
+ db ilog2c(0x900000)
+ db ilog2c(0x1000000)
+ db ilog2c(0x3000000)
+ db ilog2c(0x5000000)
+ db ilog2c(0x9000000)
+ db ilog2c(0x10000000)
+ db ilog2c(0x30000000)
+ db ilog2c(0x50000000)
+ db ilog2c(0x90000000)
diff --git a/travis/test/ilog.bin.t b/travis/test/ilog.bin.t
new file mode 100644
index 00000000..8b69b3b2
--- /dev/null
+++ b/travis/test/ilog.bin.t
Binary files differ
diff --git a/travis/test/ilog.json b/travis/test/ilog.json
new file mode 100644
index 00000000..950db5d2
--- /dev/null
+++ b/travis/test/ilog.json
@@ -0,0 +1,22 @@
+[
+ {
+ "description": "Test ilog2",
+ "id": "ilog",
+ "format": "bin",
+ "source": "ilog.asm",
+ "option": "-Ox -DWARNING",
+ "target": [
+ { "output": "ilog.bin" },
+ { "stderr": "ilog.stderr" }
+ ]
+ },
+ {
+ "description": "Test ilog2 (error)",
+ "ref": "ilog",
+ "option": "-Ox -DERROR",
+ "target": [
+ { "stderr": "ilog-error.stderr" }
+ ],
+ "error": "expected"
+ }
+]
diff --git a/travis/test/ilog.stderr b/travis/test/ilog.stderr
new file mode 100644
index 00000000..1752359f
--- /dev/null
+++ b/travis/test/ilog.stderr
@@ -0,0 +1,25 @@
+./travis/test/ilog.asm:171: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:172: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:173: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:174: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:176: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:177: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:178: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:180: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:181: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:182: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:184: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:185: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:186: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:188: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:189: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:190: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:192: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:193: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:194: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:196: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:197: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:198: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:200: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:201: warning: ilog2 argument is not a power of two [-w+other]
+./travis/test/ilog.asm:202: warning: ilog2 argument is not a power of two [-w+other]