#include "llvm/Support/KnownBits.h"
#include "KnownBitsTest.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "gtest/gtest.h"
usingnamespacellvm;
UnaryBitsFn;
UnaryIntFn;
BinaryBitsFn;
BinaryIntFn;
static testing::AssertionResult checkResult(Twine Name, const KnownBits &Exact,
const KnownBits &Computed,
ArrayRef<KnownBits> Inputs,
bool CheckOptimality) { … }
static void testUnaryOpExhaustive(StringRef Name, UnaryBitsFn BitsFn,
UnaryIntFn IntFn,
bool CheckOptimality = true) { … }
static void testBinaryOpExhaustive(StringRef Name, BinaryBitsFn BitsFn,
BinaryIntFn IntFn,
bool CheckOptimality = true,
bool RefinePoisonToZero = false) { … }
namespace {
TEST(KnownBitsTest, AddCarryExhaustive) { … }
static void TestAddSubExhaustive(bool IsAdd) { … }
TEST(KnownBitsTest, AddSubExhaustive) { … }
TEST(KnownBitsTest, SubBorrowExhaustive) { … }
TEST(KnownBitsTest, SignBitUnknown) { … }
TEST(KnownBitsTest, BinaryExhaustive) { … }
TEST(KnownBitsTest, UnaryExhaustive) { … }
TEST(KnownBitsTest, WideShifts) { … }
TEST(KnownBitsTest, ICmpExhaustive) { … }
TEST(KnownBitsTest, GetMinMaxVal) { … }
TEST(KnownBitsTest, GetSignedMinMaxVal) { … }
TEST(KnownBitsTest, CountMaxActiveBits) { … }
TEST(KnownBitsTest, CountMaxSignificantBits) { … }
TEST(KnownBitsTest, SExtOrTrunc) { … }
TEST(KnownBitsTest, SExtInReg) { … }
TEST(KnownBitsTest, CommonBitsSet) { … }
TEST(KnownBitsTest, ConcatBits) { … }
}