OLD | NEW |
1 # Copyright (c) 2015 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2015 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Proof for enabling jecxz""" | 5 """Proof that tries do not change when introducing a new attribute |
| 6 nacl-unsupported in def files.""" |
6 | 7 |
7 import proof_tools | 8 import proof_tools |
8 from proof_tools import MnemonicOp | |
9 from proof_tools import OpsProd | |
10 | |
11 | |
12 def Instructions(bitness): | |
13 """Returns 32-bit jecxz variants.""" | |
14 if bitness == 32: | |
15 jecxz = OpsProd(MnemonicOp('jecxz')) | |
16 return jecxz | |
17 return set() | |
18 | 9 |
19 | 10 |
20 def Validate(trie_diffs, bitness): | 11 def Validate(trie_diffs, bitness): |
21 """Validates that 32-bit jecxz variants are added.""" | |
22 proof_tools.AssertDiffSetEquals( | 12 proof_tools.AssertDiffSetEquals( |
23 trie_diffs, | 13 trie_diffs, |
24 expected_adds=Instructions(bitness), | 14 expected_adds=set(), |
25 expected_removes=set()) | 15 expected_removes=set()) |
26 | 16 |
27 | |
28 if __name__ == '__main__': | 17 if __name__ == '__main__': |
29 proof_tools.RunProof(proof_tools.ParseStandardOpts(), Validate) | 18 proof_tools.RunProof(proof_tools.ParseStandardOpts(), Validate) |
OLD | NEW |