diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-10-17 17:54:20 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-10-17 17:54:20 +0200 |
commit | 72ff79d76c7ec16ea1b95c72af0838f0e1150735 (patch) | |
tree | 88cd1f3aaf7138c685d89df470ccf7613eae4716 /test-asm.cpp | |
parent | 7b49d17f90f26394a116348befb5edcdffcedcb6 (diff) |
Handle Labels and Data
Diffstat (limited to 'test-asm.cpp')
-rw-r--r-- | test-asm.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test-asm.cpp b/test-asm.cpp index 882f998..50e4112 100644 --- a/test-asm.cpp +++ b/test-asm.cpp @@ -82,11 +82,14 @@ TEST_F(AsmTest, Intel64_ret) { TEST_F(AsmTest, Intel64_multiple) { Segment segment; + segment.push_back(makeOp("nop")); AsmArgs args{{Immediate8(5)}}; segment.push_back(makeOp("int", args)); segment.push_back(makeOp("ret")); + segment.push_back(makeLabel("data1")); + segment.push_back(makeData({1, 2, 3})); - ASSERT_EQ(segment.size(), 3); - ASSERT_EQ(segment.getCode(), std::vector<uint8_t>({0x90, 0xCD, 0x05, 0xC3})); + ASSERT_EQ(segment.size(), 5); + ASSERT_EQ(segment.getCode(), std::vector<uint8_t>({0x90, 0xCD, 0x05, 0xC3, 0x01, 0x02, 0x03})); } |