summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Analysis')
-rw-r--r--llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp b/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
index 6fad5c50cf4..cc053066a26 100644
--- a/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
+++ b/llvm/unittests/Analysis/BlockFrequencyInfoTest.cpp
@@ -77,8 +77,10 @@ TEST_F(BlockFrequencyInfoTest, Basic) {
EXPECT_EQ(BFI.getBlockProfileCount(&BB0).getValue(), UINT64_C(100));
EXPECT_EQ(BFI.getBlockProfileCount(BB3).getValue(), UINT64_C(100));
- EXPECT_EQ(BFI.getBlockProfileCount(BB1).getValue(), 100 * BB1Freq / BB0Freq);
- EXPECT_EQ(BFI.getBlockProfileCount(BB2).getValue(), 100 * BB2Freq / BB0Freq);
+ EXPECT_EQ(BFI.getBlockProfileCount(BB1).getValue(),
+ (100 * BB1Freq + BB0Freq / 2) / BB0Freq);
+ EXPECT_EQ(BFI.getBlockProfileCount(BB2).getValue(),
+ (100 * BB2Freq + BB0Freq / 2) / BB0Freq);
// Scale the frequencies of BB0, BB1 and BB2 by a factor of two.
SmallPtrSet<BasicBlock *, 4> BlocksToScale({BB1, BB2});
OpenPOWER on IntegriCloud