summaryrefslogtreecommitdiffhomepage
path: root/test-asm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test-asm.cpp')
-rw-r--r--test-asm.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test-asm.cpp b/test-asm.cpp
index 50e4112..d839683 100644
--- a/test-asm.cpp
+++ b/test-asm.cpp
@@ -37,6 +37,15 @@ protected:
}
};
+TEST_F(AsmTest, Intel64_add) {
+ Segment segment;
+ AsmArgs args{{Register32("eax"), Immediate32(1)}};
+ segment.push_back(makeOp("add", args));
+
+ ASSERT_EQ(segment.size(), 1);
+ ASSERT_EQ(segment.getCode(), std::vector<uint8_t>({0x05, 0x01, 0x00, 0x00, 0x00}));
+}
+
TEST_F(AsmTest, Intel64_int_0) {
Segment segment;
AsmArgs args{{Immediate8(0)}};