#include "llvm/ADT/APInt.h"
#include "llvm/Support/DivisionByConstantInfo.h"
#include "gtest/gtest.h"
usingnamespacellvm;
namespace {
template <typename Fn> static void EnumerateAPInts(unsigned Bits, Fn TestFn) { … }
APInt MULHS(APInt X, APInt Y) { … }
APInt SignedDivideUsingMagic(APInt Numerator, APInt Divisor,
SignedDivisionByConstantInfo Magics) { … }
TEST(SignedDivisionByConstantTest, Test) { … }
APInt MULHU(APInt X, APInt Y) { … }
APInt UnsignedDivideUsingMagic(const APInt &Numerator, const APInt &Divisor,
bool LZOptimization,
bool AllowEvenDivisorOptimization, bool ForceNPQ,
UnsignedDivisionByConstantInfo Magics) { … }
TEST(UnsignedDivisionByConstantTest, Test) { … }
}