Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / objc / conflicting-definition / TestConflictingDefinition.py
blob9d438cc3ee0ca32eb37ff10663fdbae456700808
1 """Test that types defined in shared libraries work correctly."""
4 import lldb
5 from lldbsuite.test.decorators import *
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test import lldbutil
10 class TestRealDefinition(TestBase):
11 def test_frame_var_after_stop_at_implementation(self):
12 """Test that we can find the implementation for an objective C type"""
13 if self.getArchitecture() == "i386":
14 self.skipTest("requires modern objc runtime")
15 self.build()
16 self.shlib_names = ["libTestExt.dylib", "libTest.dylib"]
17 self.common_setup()
19 line = line_number("TestExt/TestExt.m", "// break here")
20 lldbutil.run_break_set_by_file_and_line(
21 self, "TestExt.m", line, num_expected_locations=1, loc_exact=True
24 self.runCmd("run", RUN_SUCCEEDED)
26 # The stop reason of the thread should be breakpoint.
27 self.expect(
28 "thread list",
29 STOPPED_DUE_TO_BREAKPOINT,
30 substrs=["stopped", "stop reason = breakpoint"],
33 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
35 # This should display correctly.
36 self.expect(
37 "expr 42", "A simple expression should execute correctly", substrs=["42"]
40 def common_setup(self):
41 exe = self.getBuildArtifact("a.out")
42 target = self.dbg.CreateTarget(exe)
43 self.registerSharedLibrariesWithTarget(target, self.shlib_names)
45 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)