By comparing the disassembled output of gas-preprocessor to the disassembly from plain gas, we can easily test and make sure we handle the gas features in a similar way as the actual assembler. --- .gitignore | 3 +++ Makefile | 12 ++++++++++++ test.S | 28 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 test.S
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70494f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +test.o +disasm +disasm-ref diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91f8c38 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ + +CROSS=arm-linux-gnueabihf- + +test: + ./gas-preprocessor.pl -as-type gas -- $(CROSS)gcc -c test.S -o test.o + $(CROSS)objdump -d test.o > disasm + $(CROSS)gcc -c test.S -o test.o + $(CROSS)objdump -d test.o > disasm-ref + diff -u disasm-ref disasm + +clean: + rm -f test.o disasm disasm-ref diff --git a/test.S b/test.S new file mode 100644 index 0000000..a849616 --- /dev/null +++ b/test.S @@ -0,0 +1,28 @@ +.macro m param + .if \param + .macro inner + mov r0, #1 + .endm + .else + .macro inner + mov r0, #0 + .endm + .endif + + inner + mov r1, #\param + + .purgem inner +.endm + +m 1 +m 0 + +.irpc i, 0123 + mov r1, #\i + .iflt \i-2 + mov r2, #42 + .else + mov r3, #42 + .endif +.endr -- 1.8.5.2 (Apple Git-48) _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
