[llvm] r245270 - Add unit test for isLayoutIdentical(empty, empty).
Yaron Keren via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 00:59:10 PDT 2015
Author: yrnkrn
Date: Tue Aug 18 02:59:09 2015
New Revision: 245270
URL: http://llvm.org/viewvc/llvm-project?rev=245270&view=rev
Log:
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!
Modified:
llvm/trunk/unittests/IR/TypesTest.cpp
Modified: llvm/trunk/unittests/IR/TypesTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/TypesTest.cpp?rev=245270&r1=245269&r2=245270&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/TypesTest.cpp (original)
+++ llvm/trunk/unittests/IR/TypesTest.cpp Tue Aug 18 02:59:09 2015
@@ -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
More information about the llvm-commits
mailing list