aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts/log2.t
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-08-15 07:30:15 +0000
committerNick Clifton <nickc@redhat.com>2013-08-15 07:30:15 +0000
commit2e53f7d6010d59f1ea82d55dbe3ba41e5c460ae3 (patch)
tree510c2984267e3a436846b3634a33fc9cb5268b38 /ld/testsuite/ld-scripts/log2.t
parentdbdf691ab9456824b7650f56186e1569335c6235 (diff)
downloadgdb-2e53f7d6010d59f1ea82d55dbe3ba41e5c460ae3.zip
gdb-2e53f7d6010d59f1ea82d55dbe3ba41e5c460ae3.tar.gz
gdb-2e53f7d6010d59f1ea82d55dbe3ba41e5c460ae3.tar.bz2
* ldexp.c: Add LOG2CEIL() builtin function to linker script language
* ldgram.y: Likewise * ldlex.l: Likewise * NEWS: Mention the new feature. * ld.texinfo: Document the new feature. * ld-scripts/log2.exp: New: Run the new log2 test. * ld-scripts/log2.s: Source for the new test. * ld-scripts/log2.t: Linker script for new test.
Diffstat (limited to 'ld/testsuite/ld-scripts/log2.t')
-rw-r--r--ld/testsuite/ld-scripts/log2.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/log2.t b/ld/testsuite/ld-scripts/log2.t
new file mode 100644
index 0000000..abf73a9
--- /dev/null
+++ b/ld/testsuite/ld-scripts/log2.t
@@ -0,0 +1,8 @@
+ASSERT(LOG2CEIL(0) == 0, "LOG2CEIL(0) == 0");
+ASSERT(LOG2CEIL(1) == 0, "LOG2CEIL(1) == 0");
+ASSERT(LOG2CEIL(2) == 1, "LOG2CEIL(2) == 1");
+ASSERT(LOG2CEIL(3) == 2, "LOG2CEIL(3) == 2");
+ASSERT(LOG2CEIL(4) == 2, "LOG2CEIL(4) == 2");
+ASSERT(LOG2CEIL(0x0ff) == 8, "LOG2CEIL(0x0ff) == 8");
+ASSERT(LOG2CEIL(0x100) == 8, "LOG2CEIL(0x100) == 8");
+ASSERT(LOG2CEIL(0x1ff) == 9, "LOG2CEIL(0x1ff) == 9");