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
3// BSD-style license that can be found in the LICENSE file.
4
5#include "vm/compiler/assembler/disassembler.h"
6#include "vm/compiler/assembler/assembler.h"
7#include "vm/unit_test.h"
8#include "vm/virtual_memory.h"
9
10namespace dart {
11
12#if !defined(PRODUCT)
13
14ISOLATE_UNIT_TEST_CASE(Disassembler) {
15 compiler::ObjectPoolBuilder object_pool_builder;
16 compiler::Assembler assembler(&object_pool_builder);
17
18 // The used instructions work on all platforms.
19 Register reg = static_cast<Register>(0);
20 assembler.PopRegister(reg);
21 assembler.Stop("testing disassembler");
22
23 // Only verify that the disassembler does not crash.
24 AssemblerTest test("Disassembler", &assembler);
25 test.Assemble();
26 Disassembler::Disassemble(test.entry(), test.entry() + assembler.CodeSize());
27}
28
29#endif // !PRODUCT
30
31} // namespace dart
32