Skip to content

Commit

Permalink
Add unit test for isLayoutIdentical(empty, empty).
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yrnkrn committed Aug 18, 2015
1 parent 387ab5a commit 7b18ff7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions unittests/IR/TypesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7b18ff7

Please sign in to comment.