summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-08-18 07:59:09 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-08-18 07:59:09 +0000
commitceb04de83bc0ddb3a2f6ade5fa75b3ebe0a89d08 (patch)
tree9310f21adbc4951e3bb48c9f8583014f1930ce08
parent9f00ebaedae6c6f8eeee22c94f3825a3b1812ebd (diff)
downloadbcm5719-llvm-ceb04de83bc0ddb3a2f6ade5fa75b3ebe0a89d08.tar.gz
bcm5719-llvm-ceb04de83bc0ddb3a2f6ade5fa75b3ebe0a89d08.zip
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
-rw-r--r--llvm/unittests/IR/TypesTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/IR/TypesTest.cpp b/llvm/unittests/IR/TypesTest.cpp
index 2cee640a13d..b4dbf8ec2c7 100644
--- a/llvm/unittests/IR/TypesTest.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud