From 59aee848df95d80b37de8819a69defacb11be0e9 Mon Sep 17 00:00:00 2001 From: Jacob Bramley Date: Thu, 23 Aug 2018 18:13:09 +0100 Subject: Support hint , and fix hint disassembly. This allows users to use custom hints without resorting to an undefined static_cast. Also, fix disassembly of hints: - Add several named hints to the disassembler, so they can be properly disassembled. - Properly disassemble unnamed hints. Change-Id: Ia8b4d07a5bff08346faebd5b2f495d047d7037c0 --- test/aarch64/test-disasm-aarch64.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/aarch64') diff --git a/test/aarch64/test-disasm-aarch64.cc b/test/aarch64/test-disasm-aarch64.cc index 426319ff..b494780c 100644 --- a/test/aarch64/test-disasm-aarch64.cc +++ b/test/aarch64/test-disasm-aarch64.cc @@ -7018,5 +7018,29 @@ TEST(address_map) { CLEANUP(); } +TEST(hint) { + SETUP(); + + // Test that we properly disassemble named and unnamed hints. + COMPARE(hint(NOP), "nop"); + COMPARE(hint(YIELD), "yield"); + COMPARE(hint(WFE), "wfe"); + COMPARE(hint(WFI), "wfi"); + COMPARE(hint(SEV), "sev"); + COMPARE(hint(SEVL), "sevl"); + COMPARE(hint(6), "hint #6"); + COMPARE(hint(CSDB), "csdb"); + COMPARE(hint(42), "hint #42"); + COMPARE(hint(127), "hint #127"); + + // The MacroAssembler should simply pass through to the Assembler. + COMPARE_MACRO(Hint(NOP), "nop"); + COMPARE_MACRO(Hint(CSDB), "csdb"); + COMPARE_MACRO(Hint(42), "hint #42"); + COMPARE_MACRO(Hint(127), "hint #127"); + + CLEANUP(); +} + } // namespace aarch64 } // namespace vixl -- cgit v1.2.3