Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: src/trusted/validator_ragel/gen_dfa_test.py

Issue 12090047: Validator_ragel: REX prefix support in gen_dfa.py. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: comments Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_ragel/gen_dfa.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_ragel/gen_dfa_test.py
diff --git a/src/trusted/validator_ragel/gen_dfa_test.py b/src/trusted/validator_ragel/gen_dfa_test.py
index 726ca719c822ad05d5932f90cc9aacecfc1f4034..51b26a7cd31fa708b765fc399d19f4a61a45503c 100644
--- a/src/trusted/validator_ragel/gen_dfa_test.py
+++ b/src/trusted/validator_ragel/gen_dfa_test.py
@@ -186,6 +186,48 @@ class TestInstructionPrinter(unittest.TestCase):
@operand0_jmp_to
""".split())
+ def test_no_modrm_with_rex(self):
+ printer = gen_dfa.InstructionPrinter(gen_dfa.DECODER, 64)
+ instr = gen_dfa.Instruction.Parse(
+ 'movabs Od !ad, 0xa0, amd64 nacl-forbidden')
+
+ printer.PrintInstructionWithoutModRM(instr)
+
+ self.assertEquals(
+ printer.GetContent().split(),
+ """
+ REX_RXB?
+ 0xa0
+ @instruction_movabs
+ @operands_count_is_2
+ @operand0_32bit
+ @operand1_32bit
+ @set_spurious_rex_b
+ @set_spurious_rex_x
+ @set_spurious_rex_r
+ @operand1_rax
+ @operand0_absolute_disp
+ disp64
+ """.split())
+
+ def test_nop_with_rex(self):
+ printer = gen_dfa.InstructionPrinter(gen_dfa.DECODER, 64)
+ instr = gen_dfa.Instruction.Parse(
+ 'nop, 0x40 0x90, amd64 norex')
+
+ printer.PrintInstructionWithoutModRM(instr)
+
+ self.assertEquals(
+ printer.GetContent().split(),
+ """
+ 0x40 0x90
+ @instruction_nop
+ @operands_count_is_0
+ @set_spurious_rex_b
+ @set_spurious_rex_x
+ @set_spurious_rex_r
+ """.split())
+
class TestParser(unittest.TestCase):
« no previous file with comments | « src/trusted/validator_ragel/gen_dfa.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698