old-cross-binutils/ld/testsuite/ld-scripts/log2.t
Nick Clifton 2e53f7d601 * 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.
2013-08-15 07:30:15 +00:00

8 lines
420 B
Perl

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");