From: Yaron Keren Date: Tue, 18 Aug 2015 07:59:09 +0000 (+0000) Subject: Add unit test for isLayoutIdentical(empty, empty). X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b18ff7dd264df9675ff607d70315a8dbb370522;p=oota-llvm.git 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 --- diff --git a/unittests/IR/TypesTest.cpp b/unittests/IR/TypesTest.cpp index 2cee640a13d..b4dbf8ec2c7 100644 --- a/unittests/IR/TypesTest.cpp +++ b/unittests/IR/TypesTest.cpp @@ -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