From 72ff79d76c7ec16ea1b95c72af0838f0e1150735 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 17 Oct 2020 17:54:20 +0200 Subject: Handle Labels and Data --- test-asm.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test-asm.cpp') 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({0x90, 0xCD, 0x05, 0xC3})); + ASSERT_EQ(segment.size(), 5); + ASSERT_EQ(segment.getCode(), std::vector({0x90, 0xCD, 0x05, 0xC3, 0x01, 0x02, 0x03})); } -- cgit v1.2.3