diff options
Diffstat (limited to 'llvm/unittests/Analysis')
-rw-r--r-- | llvm/unittests/Analysis/IR2VecTest.cpp | 22 | ||||
-rw-r--r-- | llvm/unittests/Analysis/MemorySSATest.cpp | 4 |
2 files changed, 14 insertions, 12 deletions
diff --git a/llvm/unittests/Analysis/IR2VecTest.cpp b/llvm/unittests/Analysis/IR2VecTest.cpp index e288585..f7838cc4 100644 --- a/llvm/unittests/Analysis/IR2VecTest.cpp +++ b/llvm/unittests/Analysis/IR2VecTest.cpp @@ -320,11 +320,13 @@ TEST_F(IR2VecTestFixture, GetInstVecMap) { EXPECT_TRUE(InstMap.count(AddInst)); EXPECT_TRUE(InstMap.count(RetInst)); - EXPECT_EQ(InstMap.at(AddInst).size(), 2u); - EXPECT_EQ(InstMap.at(RetInst).size(), 2u); + const auto &AddEmb = InstMap.at(AddInst); + const auto &RetEmb = InstMap.at(RetInst); + EXPECT_EQ(AddEmb.size(), 2u); + EXPECT_EQ(RetEmb.size(), 2u); - EXPECT_TRUE(InstMap.at(AddInst).approximatelyEquals(Embedding(2, 27.6))); - EXPECT_TRUE(InstMap.at(RetInst).approximatelyEquals(Embedding(2, 16.8))); + EXPECT_TRUE(AddEmb.approximatelyEquals(Embedding(2, 27.9))); + EXPECT_TRUE(RetEmb.approximatelyEquals(Embedding(2, 17.0))); } TEST_F(IR2VecTestFixture, GetBBVecMap) { @@ -337,9 +339,9 @@ TEST_F(IR2VecTestFixture, GetBBVecMap) { EXPECT_TRUE(BBMap.count(BB)); EXPECT_EQ(BBMap.at(BB).size(), 2u); - // BB vector should be sum of add and ret: {27.6, 27.6} + {16.8, 16.8} = - // {44.4, 44.4} - EXPECT_TRUE(BBMap.at(BB).approximatelyEquals(Embedding(2, 44.4))); + // BB vector should be sum of add and ret: {27.9, 27.9} + {17.0, 17.0} = + // {44.9, 44.9} + EXPECT_TRUE(BBMap.at(BB).approximatelyEquals(Embedding(2, 44.9))); } TEST_F(IR2VecTestFixture, GetBBVector) { @@ -349,7 +351,7 @@ TEST_F(IR2VecTestFixture, GetBBVector) { const auto &BBVec = Emb->getBBVector(*BB); EXPECT_EQ(BBVec.size(), 2u); - EXPECT_TRUE(BBVec.approximatelyEquals(Embedding(2, 44.4))); + EXPECT_TRUE(BBVec.approximatelyEquals(Embedding(2, 44.9))); } TEST_F(IR2VecTestFixture, GetFunctionVector) { @@ -360,8 +362,8 @@ TEST_F(IR2VecTestFixture, GetFunctionVector) { EXPECT_EQ(FuncVec.size(), 2u); - // Function vector should match BB vector (only one BB): {44.4, 44.4} - EXPECT_TRUE(FuncVec.approximatelyEquals(Embedding(2, 44.4))); + // Function vector should match BB vector (only one BB): {44.9, 44.9} + EXPECT_TRUE(FuncVec.approximatelyEquals(Embedding(2, 44.9))); } static constexpr unsigned MaxOpcodes = Vocabulary::MaxOpcodes; diff --git a/llvm/unittests/Analysis/MemorySSATest.cpp b/llvm/unittests/Analysis/MemorySSATest.cpp index 1a9296f..fceefbc 100644 --- a/llvm/unittests/Analysis/MemorySSATest.cpp +++ b/llvm/unittests/Analysis/MemorySSATest.cpp @@ -1092,8 +1092,8 @@ TEST_F(MemorySSATest, LifetimeMarkersAreClobbers) { // %baz = getelementptr i8, ptr %foo, i64 2 // store i8 0, ptr %foo // store i8 0, ptr %bar - // call void @llvm.lifetime.end.p0(i64 3, ptr %foo) - // call void @llvm.lifetime.start.p0(i64 3, ptr %foo) + // call void @llvm.lifetime.end.p0(ptr %foo) + // call void @llvm.lifetime.start.p0(ptr %foo) // store i8 0, ptr %foo // store i8 0, ptr %bar // call void @llvm.memset.p0i8(ptr %baz, i8 0, i64 1) |