diff options
Diffstat (limited to 'llvm/unittests/IR/MetadataTest.cpp')
-rw-r--r-- | llvm/unittests/IR/MetadataTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index 3ab0ad4..76c1903 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -1314,6 +1314,11 @@ TEST_F(DICompositeTypeTest, replaceOperands) { EXPECT_EQ(nullptr, N->getVTableHolder()); N->replaceVTableHolder(VTableHolder); EXPECT_EQ(VTableHolder, N->getVTableHolder()); + // As an extension, the containing type can be anything. This is + // used by Rust to associate vtables with their concrete type. + DIType *BasicType = getBasicType("basic"); + N->replaceVTableHolder(BasicType); + EXPECT_EQ(BasicType, N->getVTableHolder()); N->replaceVTableHolder(nullptr); EXPECT_EQ(nullptr, N->getVTableHolder()); |