diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-29 16:44:59 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-29 16:44:59 +0000 |
commit | 31413d8f1d2acd6ea164db3cf6d4d5ca004366a0 (patch) | |
tree | f5a844da3b3bf36174aa56d73a84ed274d309cb0 /unittests | |
parent | 3dbfacec2ebe7f8aa303987b9b4b24500a8ce164 (diff) | |
download | llvm-31413d8f1d2acd6ea164db3cf6d4d5ca004366a0.tar.gz llvm-31413d8f1d2acd6ea164db3cf6d4d5ca004366a0.tar.bz2 llvm-31413d8f1d2acd6ea164db3cf6d4d5ca004366a0.tar.xz |
Support: More BlockFrequencyTest => BranchProbabilityTest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/BlockFrequencyTest.cpp | 29 | ||||
-rw-r--r-- | unittests/Support/BranchProbabilityTest.cpp | 29 |
2 files changed, 29 insertions, 29 deletions
diff --git a/unittests/Support/BlockFrequencyTest.cpp b/unittests/Support/BlockFrequencyTest.cpp index 94c7a3505f..f6e3537de9 100644 --- a/unittests/Support/BlockFrequencyTest.cpp +++ b/unittests/Support/BlockFrequencyTest.cpp @@ -102,35 +102,6 @@ TEST(BlockFrequencyTest, Saturate) { EXPECT_EQ(33506781356485509ULL, Freq.getFrequency()); } -TEST(BlockFrequencyTest, ProbabilityCompare) { - BranchProbability A(4, 5); - BranchProbability B(4U << 29, 5U << 29); - BranchProbability C(3, 4); - - EXPECT_TRUE(A == B); - EXPECT_FALSE(A != B); - EXPECT_FALSE(A < B); - EXPECT_FALSE(A > B); - EXPECT_TRUE(A <= B); - EXPECT_TRUE(A >= B); - - EXPECT_FALSE(B == C); - EXPECT_TRUE(B != C); - EXPECT_FALSE(B < C); - EXPECT_TRUE(B > C); - EXPECT_FALSE(B <= C); - EXPECT_TRUE(B >= C); - - BranchProbability BigZero(0, UINT32_MAX); - BranchProbability BigOne(UINT32_MAX, UINT32_MAX); - EXPECT_FALSE(BigZero == BigOne); - EXPECT_TRUE(BigZero != BigOne); - EXPECT_TRUE(BigZero < BigOne); - EXPECT_FALSE(BigZero > BigOne); - EXPECT_TRUE(BigZero <= BigOne); - EXPECT_FALSE(BigZero >= BigOne); -} - TEST(BlockFrequencyTest, SaturatingRightShift) { BlockFrequency Freq(0x10080ULL); Freq >>= 2; diff --git a/unittests/Support/BranchProbabilityTest.cpp b/unittests/Support/BranchProbabilityTest.cpp index 519fe29b89..09061de332 100644 --- a/unittests/Support/BranchProbabilityTest.cpp +++ b/unittests/Support/BranchProbabilityTest.cpp @@ -80,6 +80,35 @@ TEST(BranchProbabilityTest, Operators) { EXPECT_TRUE(BP(4, 7) != BP(3, 7)); } +TEST(BlockProbabilityTest, MoreOperators) { + BP A(4, 5); + BP B(4U << 29, 5U << 29); + BP C(3, 4); + + EXPECT_TRUE(A == B); + EXPECT_FALSE(A != B); + EXPECT_FALSE(A < B); + EXPECT_FALSE(A > B); + EXPECT_TRUE(A <= B); + EXPECT_TRUE(A >= B); + + EXPECT_FALSE(B == C); + EXPECT_TRUE(B != C); + EXPECT_FALSE(B < C); + EXPECT_TRUE(B > C); + EXPECT_FALSE(B <= C); + EXPECT_TRUE(B >= C); + + BP BigZero(0, UINT32_MAX); + BP BigOne(UINT32_MAX, UINT32_MAX); + EXPECT_FALSE(BigZero == BigOne); + EXPECT_TRUE(BigZero != BigOne); + EXPECT_TRUE(BigZero < BigOne); + EXPECT_FALSE(BigZero > BigOne); + EXPECT_TRUE(BigZero <= BigOne); + EXPECT_FALSE(BigZero >= BigOne); +} + TEST(BranchProbabilityTest, getCompl) { EXPECT_EQ(BP(5, 7), BP(2, 7).getCompl()); EXPECT_EQ(BP(2, 7), BP(5, 7).getCompl()); |