mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Support: More BlockFrequencyTest => BranchProbabilityTest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3dbfacec2e
commit
31413d8f1d
@ -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;
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user