Index: src/common/dwarf_cu_to_module_unittest.cc |
diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc |
index 0ae73e8167946487711c4b3b760112e3faa2ad51..619e90a2ee5b95e0d2159de001e9b7338b2d6630 100644 |
--- a/src/common/dwarf_cu_to_module_unittest.cc |
+++ b/src/common/dwarf_cu_to_module_unittest.cc |
@@ -1323,6 +1323,29 @@ TEST_F(Specifications, InlineFunction) { |
0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL); |
} |
+// An inline function in a namespace should correctly derive its |
+// name from its abstract origin, and not just the namespace name. |
+TEST_F(Specifications, InlineFunctionInNamespace) { |
+ PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118); |
+ |
+ StartCU(); |
+ DIEHandler* space_handler |
+ = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace, |
+ "Namespace"); |
+ ASSERT_TRUE(space_handler != NULL); |
+ AbstractInstanceDIE(space_handler, 0x1e8dac5d507ed7abULL, |
+ dwarf2reader::DW_INL_inlined, 0LL, "func-name"); |
+ DefineInlineInstanceDIE(space_handler, "", 0x1e8dac5d507ed7abULL, |
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL); |
+ space_handler->Finish(); |
+ delete space_handler; |
+ root_handler_.Finish(); |
+ |
+ TestFunctionCount(1); |
+ TestFunction(0, "Namespace::func-name", |
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL); |
+} |
+ |
// Check name construction for a long chain containing each combination of: |
// - struct, union, class, namespace |
// - direct and definition |