OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/assembler.h" | 5 #include "vm/assembler.h" |
6 #include "vm/disassembler.h" | 6 #include "vm/disassembler.h" |
7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
8 #include "vm/virtual_memory.h" | 8 #include "vm/virtual_memory.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
| 12 #ifndef PRODUCT |
| 13 |
12 TEST_CASE(Disassembler) { | 14 TEST_CASE(Disassembler) { |
13 Assembler assembler; | 15 Assembler assembler; |
14 // The used instructions work on all platforms. | 16 // The used instructions work on all platforms. |
15 Register reg = static_cast<Register>(0); | 17 Register reg = static_cast<Register>(0); |
16 assembler.PopRegister(reg); | 18 assembler.PopRegister(reg); |
17 assembler.Stop("testing disassembler"); | 19 assembler.Stop("testing disassembler"); |
18 | 20 |
19 // Only verify that the disassembler does not crash. | 21 // Only verify that the disassembler does not crash. |
20 AssemblerTest test("Disassembler", &assembler); | 22 AssemblerTest test("Disassembler", &assembler); |
21 test.Assemble(); | 23 test.Assemble(); |
22 Disassembler::Disassemble(test.entry(), test.entry() + assembler.CodeSize()); | 24 Disassembler::Disassemble(test.entry(), test.entry() + assembler.CodeSize()); |
23 } | 25 } |
24 | 26 |
| 27 #endif // !PRODUCT |
| 28 |
25 } // namespace dart | 29 } // namespace dart |
OLD | NEW |