// Copyright 2011 Google Inc. All Rights Reserved. | |
// Author: cshapiro@google.com (Carl Shapiro) | |
#include "assembler_x86.h" | |
#include "gtest/gtest.h" | |
namespace art { | |
TEST(AssemblerX86, CreateBuffer) { | |
AssemblerBuffer buffer; | |
AssemblerBuffer::EnsureCapacity ensured(&buffer); | |
buffer.Emit<uint8_t>(0x42); | |
ASSERT_EQ(static_cast<size_t>(1), buffer.Size()); | |
buffer.Emit<int32_t>(42); | |
ASSERT_EQ(static_cast<size_t>(5), buffer.Size()); | |
} | |
} // namespace art |