[PATCH] D51238: Add a unit test for DILocation::getMergedLocation()

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 15:58:05 PDT 2018


aprantl added inline comments.


================
Comment at: unittests/IR/MetadataTest.cpp:924
+    // FIXME: What scope?
+    EXPECT_TRUE(isa<DILocalScope>(M->getScope()));
+    EXPECT_EQ(I, M->getInlinedAt());
----------------
This triggers an assertion in `DILocation::getScope()` because the DIFile is not a DILocalScope.

Some ideas for fixing this:
- create a new dummy DISubprogram(name: "$llvm$merged$foo$bar")
- randomly pick one location's scope (it's line 0 after all)


https://reviews.llvm.org/D51238





More information about the llvm-commits mailing list