brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · f0a7aef Raw
30 lines · python
1"""2Tests that we can call functions that have definitions in multiple3CUs in the debug-info (which is the case for functions defined in headers).4The linker will most likely de-duplicate the functiond definitions when linking5the final executable. On Darwin, this will create a debug-map that LLDB will use6to fix up object file addresses to addresses in the linked executable. However,7if we parsed the DIE from the object file whose functiond definition got stripped8by the linker, LLDB needs to ensure it can still resolve the function symbol it9got for it.10"""11 12import lldb13from lldbsuite.test.decorators import *14from lldbsuite.test.lldbtest import *15from lldbsuite.test import lldbutil16 17 18class TestFunctionCallFromObjectFile(TestBase):19    def test_lib1(self):20        self.build()21        lldbutil.run_to_name_breakpoint(self, "lib1_func")22 23        self.expect_expr("Foo{}.foo()", result_type="int", result_value="15")24 25    def test_lib2(self):26        self.build()27        lldbutil.run_to_name_breakpoint(self, "lib2_func")28 29        self.expect_expr("Foo{}.foo()", result_type="int", result_value="15")30