1"""Test that inline functions from modules are imported correctly""" 2 3 4 5 6import unittest2 7 8import lldb 9from lldbsuite.test.decorators import * 10from lldbsuite.test.lldbtest import * 11from lldbsuite.test import lldbutil 12 13 14class ModulesInlineFunctionsTestCase(TestBase): 15 16 @skipIf(macos_version=["<", "10.12"], debug_info=no_match(["gmodules"])) 17 def test_expr(self): 18 self.build() 19 exe = self.getBuildArtifact("a.out") 20 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) 21 22 # Break inside the foo function which takes a bar_ptr argument. 23 lldbutil.run_to_source_breakpoint( 24 self, '// Set breakpoint here.', lldb.SBFileSpec('main.m')) 25 26 self.runCmd( 27 "settings set target.clang-module-search-paths \"" + 28 self.getSourceDir() + 29 "\"") 30 31 self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY, 32 substrs=["int", "3"]) 33 34 self.expect("expr isInline(2)", VARIABLES_DISPLAYED_CORRECTLY, 35 substrs=["4"]) 36