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