llvm.org GIT mirror llvm / fe3176f
InstrProf: Add a test for multiple copies of the same with different hashes This functionality wasn't being tested. Patch by Betul Buyukkurt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240359 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 4 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
6767
6868 TEST_F(InstrProfTest, get_function_counts) {
6969 Writer.addFunctionCounts("foo", 0x1234, {1, 2});
70 Writer.addFunctionCounts("foo", 0x1235, {3, 4});
7071 auto Profile = Writer.writeBuffer();
7172 readProfile(std::move(Profile));
7273
7576 ASSERT_EQ(2U, Counts.size());
7677 ASSERT_EQ(1U, Counts[0]);
7778 ASSERT_EQ(2U, Counts[1]);
79
80 ASSERT_TRUE(NoError(Reader->getFunctionCounts("foo", 0x1235, Counts)));
81 ASSERT_EQ(2U, Counts.size());
82 ASSERT_EQ(3U, Counts[0]);
83 ASSERT_EQ(4U, Counts[1]);
7884
7985 std::error_code EC;
8086 EC = Reader->getFunctionCounts("foo", 0x5678, Counts);