blob: ffe3d0bb78f4b357560069a0ddc52caf0ff91615 [file] [log] [blame]
Jesse Wilsonc981ace2011-06-22 14:17:14 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2// Author: cshapiro@google.com (Carl Shapiro)
Ian Rogersb033c752011-07-20 12:22:35 -07003
Brian Carlstrom578bbdc2011-07-21 14:07:47 -07004#include "assembler_x86.h"
Jesse Wilsonc981ace2011-06-22 14:17:14 -07005
Jesse Wilsonc981ace2011-06-22 14:17:14 -07006#include "gtest/gtest.h"
7
Ian Rogersb033c752011-07-20 12:22:35 -07008namespace art {
9
10TEST(AssemblerX86, CreateBuffer) {
11 AssemblerBuffer buffer;
12 AssemblerBuffer::EnsureCapacity ensured(&buffer);
13 buffer.Emit<uint8_t>(0x42);
14 ASSERT_EQ(static_cast<size_t>(1), buffer.Size());
15 buffer.Emit<int32_t>(42);
16 ASSERT_EQ(static_cast<size_t>(5), buffer.Size());
Jesse Wilsonc981ace2011-06-22 14:17:14 -070017}
Ian Rogersb033c752011-07-20 12:22:35 -070018
19} // namespace art