summaryrefslogtreecommitdiffhomepage
path: root/test-asm.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-10-17 21:45:37 +0200
committerRoland Reichwein <mail@reichwein.it>2020-10-17 21:45:37 +0200
commit8f28495ab9a8ebf53868405541e907394895e51f (patch)
tree51b27870ed64522e1d54e4f031276e18fe181ee8 /test-asm.cpp
parent72ff79d76c7ec16ea1b95c72af0838f0e1150735 (diff)
Add add
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)}};