Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / objc / modules-incomplete / TestIncompleteModules.py
blobfc4352e5448b328758057449c87ecb5269aef198
1 """Test that DWARF types are trusted over module types"""
4 from lldbsuite.test.decorators import *
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test import lldbutil
9 class IncompleteModulesTestCase(TestBase):
10 def setUp(self):
11 # Call super's setUp().
12 TestBase.setUp(self)
13 # Find the line number to break inside main().
14 self.line = line_number("main.m", "// Set breakpoint 0 here.")
16 @add_test_categories(["gmodules"])
17 def test_expr(self):
18 self.build()
19 exe = self.getBuildArtifact("a.out")
20 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
21 lldbutil.run_break_set_by_file_and_line(
22 self, "main.m", self.line, num_expected_locations=1, loc_exact=True
25 self.runCmd("run", RUN_SUCCEEDED)
27 # The stop reason of the thread should be breakpoint.
28 self.expect(
29 "thread list",
30 STOPPED_DUE_TO_BREAKPOINT,
31 substrs=["stopped", "stop reason = breakpoint"],
34 # The breakpoint should have a hit count of 1.
35 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
37 self.runCmd(
38 'settings set target.clang-module-search-paths "'
39 + self.getSourceDir()
40 + '"'
43 self.expect(
44 "expr @import myModule; 3",
45 VARIABLES_DISPLAYED_CORRECTLY,
46 substrs=["int", "3"],
49 self.expect(
50 "expr private_func()", VARIABLES_DISPLAYED_CORRECTLY, substrs=["int", "5"]
53 self.expect(
54 "expr MY_MIN(2,3)", "#defined macro was found", substrs=["int", "2"]
57 self.expect(
58 "expr MY_MAX(2,3)", "#undefd macro was correctly not found", error=True