mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Fix a bad overflow check pointed out by Ben.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185226 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -68,6 +68,11 @@ TEST(BlockFrequencyTest, Saturate) {
|
||||
Freq = 0x1000000000000000ULL;
|
||||
Freq /= BranchProbability(10000, 160000);
|
||||
EXPECT_EQ(Freq.getFrequency(), UINT64_MAX);
|
||||
|
||||
// Try to cheat the multiplication overflow check.
|
||||
Freq = 0x00000001f0000001ull;
|
||||
Freq /= BranchProbability(1000, 0xf000000f);
|
||||
EXPECT_EQ(33506781356485509ULL, Freq.getFrequency());
|
||||
}
|
||||
|
||||
TEST(BlockFrequencyTest, ProbabilityCompare) {
|
||||
|
Reference in New Issue
Block a user