diff options
Diffstat (limited to 'llvm/unittests/IR/LLVMContextTest.cpp')
-rw-r--r-- | llvm/unittests/IR/LLVMContextTest.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/unittests/IR/LLVMContextTest.cpp b/llvm/unittests/IR/LLVMContextTest.cpp index f1eeb05b1cb..028dc68827b 100644 --- a/llvm/unittests/IR/LLVMContextTest.cpp +++ b/llvm/unittests/IR/LLVMContextTest.cpp @@ -32,18 +32,20 @@ TEST(LLVMContextTest, getOrInsertODRUniquedType) { // Get the mapping. Context.enableDebugTypeODRUniquing(); - DIType **Mapping = Context.getOrInsertODRUniquedType(S); + DICompositeType **Mapping = Context.getOrInsertODRUniquedType(S); ASSERT_TRUE(Mapping); // Create some type and add it to the mapping. - auto &BT = - *DIBasicType::get(Context, dwarf::DW_TAG_unspecified_type, S.getString()); - *Mapping = &BT; + auto &CT = *DICompositeType::get(Context, dwarf::DW_TAG_class_type, "name", + nullptr, 0, nullptr, nullptr, 0, 0, 0, 0, + nullptr, 0, nullptr, nullptr, S.getString()); + ASSERT_EQ(S.getString(), CT.getIdentifier()); + *Mapping = &CT; // Check that we get it back. Mapping = Context.getOrInsertODRUniquedType(S); ASSERT_TRUE(Mapping); - EXPECT_EQ(&BT, *Mapping); + EXPECT_EQ(&CT, *Mapping); // Check that it's discarded with the type map. Context.disableDebugTypeODRUniquing(); |