Generate simple tests for MacroAssembler functions.
The new MacroAssembler tests work like the generated Assembler and Simulator
tests. The assembled code is not executed (so the tests take no inputs).
The tests are intended to provide coverage of all the valid uses of the
MacroAssembler, to ensure that it does not crash for valid inputs. There is
potential to extend the framework later to check the disassembly against a
reference, but the reference would need to be checked manually in many cases, so
this is not implemented yet.
Most of this patch is infrastructure, but some simple tests are included.
Change-Id: I8fdb89426c0202cd8b724fbbe7b6e1c077e85be1
diff --git a/tools/generate_tests.py b/tools/generate_tests.py
index 06e89f4..9831f85 100755
--- a/tools/generate_tests.py
+++ b/tools/generate_tests.py
@@ -380,11 +380,13 @@
- "test/aarch32/test-simulator-{configuration name}-a32.cc"
The "type" field describes the kind of testing we want to do, these types are
-recognized by the generator and, at the moment, can be one of "simulator" or
-"assembler". Simulator tests will run each instruction and record the
-changes while assembler tests will only record the code buffer and never execute
-anything. Because you may want to generate more than one test of the same type,
-as we are doing in the example, we need a way to differentiate them. You may use
+recognized by the generator and, at the moment, can be one of "simulator",
+"assembler" and "macro-assembler". Simulator tests will run each instruction and
+record the changes while assembler tests will only record the code buffer and
+never execute anything. MacroAssembler tests currently only generate code to
+check that the MacroAssembler does not crash; the output itself is not yet
+tested. Because you may want to generate more than one test of the same type, as
+we are doing in the example, we need a way to differentiate them. You may use
the optional "name" field for this.
Finally, we describe how to test the instruction by declaring a list of test
@@ -621,6 +623,7 @@
'test/aarch32/config/cond-rd-rn-operand-rm-shift-rs-a32.json',
'test/aarch32/config/cond-rd-rn-operand-rm-ror-amount-a32.json',
'test/aarch32/config/cond-rd-rn-a32.json',
+ 'test/aarch32/config/cond-rd-rn-pc-a32.json',
'test/aarch32/config/cond-rd-rn-rm-a32.json',
'test/aarch32/config/cond-rd-operand-const-a32.json',
'test/aarch32/config/cond-rd-operand-rn-a32.json',
@@ -664,6 +667,7 @@
template_files = {
'simulator': "test/aarch32/config/template-simulator-aarch32.cc.in",
'assembler': "test/aarch32/config/template-assembler-aarch32.cc.in",
+ 'macro-assembler': "test/aarch32/config/template-macro-assembler-aarch32.cc.in",
}