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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yaron Keren 2015-08-18 07:59:09 +00:00
parent 387ab5afe7
commit 7b18ff7dd2

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