IR: Add missing null operand to MDSubroutineType
Add missing `nullptr` from `MDSubroutineType`'s operands for
`MDCompositeTypeBase::getIdentifier()` (and add tests for all the other
unused fields). This highlights just how crazy it is that
`MDSubroutineType` inherits from `MDCompositeTypeBase`.
llvm-svn: 229926
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index ea49880..0c1ef82 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -964,6 +964,15 @@
TempMDSubroutineType Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
+
+ // Test always-empty operands.
+ EXPECT_EQ(nullptr, N->getScope());
+ EXPECT_EQ(nullptr, N->getFile());
+ EXPECT_EQ("", N->getName());
+ EXPECT_EQ(nullptr, N->getBaseType());
+ EXPECT_EQ(nullptr, N->getVTableHolder());
+ EXPECT_EQ(nullptr, N->getTemplateParams());
+ EXPECT_EQ("", N->getIdentifier());
}
typedef MetadataTest MDFileTest;