parent
8292bdf735
commit
9d95557128
|
@ -169,11 +169,13 @@ public:
|
|||
|
||||
void print(raw_ostream &OS) const;
|
||||
|
||||
bool operator ==(const LLT &RHS) const {
|
||||
bool operator==(const LLT &RHS) const {
|
||||
return Kind == RHS.Kind && SizeOrAddrSpace == RHS.SizeOrAddrSpace &&
|
||||
NumElements == RHS.NumElements;
|
||||
}
|
||||
|
||||
bool operator!=(const LLT &RHS) const { return !(*this == RHS); }
|
||||
|
||||
friend struct DenseMapInfo<LLT>;
|
||||
private:
|
||||
unsigned SizeOrAddrSpace;
|
||||
|
|
|
@ -60,6 +60,9 @@ TEST(LowLevelTypeTest, Scalar) {
|
|||
|
||||
// Test equality operators.
|
||||
EXPECT_TRUE(Ty == Ty);
|
||||
EXPECT_FALSE(Ty != Ty);
|
||||
|
||||
EXPECT_NE(Ty, DoubleTy);
|
||||
|
||||
// Test Type->LLT conversion.
|
||||
const Type *IRTy = IntegerType::get(C, S);
|
||||
|
@ -141,6 +144,15 @@ TEST(LowLevelTypeTest, Vector) {
|
|||
|
||||
// Test equality operators.
|
||||
EXPECT_TRUE(VTy == VTy);
|
||||
EXPECT_FALSE(VTy != VTy);
|
||||
|
||||
// Test inequality operators on..
|
||||
// ..different kind.
|
||||
EXPECT_NE(VTy, STy);
|
||||
// ..different #elts.
|
||||
EXPECT_NE(VTy, DoubleEltTy);
|
||||
// ..different scalar size.
|
||||
EXPECT_NE(VTy, DoubleSzTy);
|
||||
|
||||
// Test Type->LLT conversion.
|
||||
Type *IRSTy = IntegerType::get(C, S);
|
||||
|
@ -169,6 +181,7 @@ TEST(LowLevelTypeTest, Pointer) {
|
|||
|
||||
// Test equality operators.
|
||||
EXPECT_TRUE(Ty == Ty);
|
||||
EXPECT_FALSE(Ty != Ty);
|
||||
|
||||
// Test Type->LLT conversion.
|
||||
const Type *IRTy = PointerType::get(IntegerType::get(C, 8), AS);
|
||||
|
|
Loading…
Reference in New Issue