Add unit test for isLayoutIdentical(empty, empty).

It was previously asserting in Visual C++ debug mode on a null
iterator passed to std::equal.

Test by Hans Wennborg!

llvm-svn: 245270
This commit is contained in:
Yaron Keren 2015-08-18 07:59:09 +00:00
parent 82f54ac1cb
commit 60a96994e9

View File

@ -27,4 +27,12 @@ TEST(TypesTest, StructType) {
EXPECT_FALSE(Struct->hasName());
}
TEST(TypesTest, LayoutIdenticalEmptyStructs) {
LLVMContext C;
StructType *Foo = StructType::create(C, "Foo");
StructType *Bar = StructType::create(C, "Bar");
EXPECT_TRUE(Foo->isLayoutIdentical(Bar));
}
} // end anonymous namespace