Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / namespace_definitions / TestNamespaceDefinitions.py
blob4eb33bfd2da591be57ddaf0059fec85037deb6b8
1 """Test that forward declarations don't cause bogus conflicts in namespaced types"""
4 import lldb
5 from lldbsuite.test.lldbtest import *
6 from lldbsuite.test.decorators import *
7 import lldbsuite.test.lldbutil as lldbutil
10 class NamespaceDefinitionsTestCase(TestBase):
11 # See also llvm.org/pr28948
12 @expectedFailureAll(bugnumber="llvm.org/pr50814", compiler="gcc")
13 @expectedFailureAll(
14 bugnumber="llvm.org/pr28948",
15 oslist=["linux"],
16 compiler="gcc",
17 archs=["arm", "aarch64"],
19 @expectedFailureAll(oslist=["windows"])
20 def test_expr(self):
21 self.build()
22 self.common_setup()
24 self.expect(
25 "expression -- Foo::MyClass()",
26 VARIABLES_DISPLAYED_CORRECTLY,
27 substrs=["thing = "],
30 def setUp(self):
31 # Call super's setUp().
32 TestBase.setUp(self)
33 # Find the line number to break inside main().
34 self.source = "main.cpp"
35 self.line = line_number(self.source, "// Set breakpoint here")
36 self.shlib_names = ["a", "b"]
38 def common_setup(self):
39 # Run in synchronous mode
40 self.dbg.SetAsync(False)
42 # Create a target by the debugger.
43 target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
44 self.assertTrue(target, VALID_TARGET)
46 # Break inside the foo function which takes a bar_ptr argument.
47 lldbutil.run_break_set_by_file_and_line(
48 self, self.source, self.line, num_expected_locations=1, loc_exact=True
51 # Register our shared libraries for remote targets so they get
52 # automatically uploaded
53 environment = self.registerSharedLibrariesWithTarget(target, self.shlib_names)
55 # Now launch the process, and do not stop at entry point.
56 process = target.LaunchSimple(
57 None, environment, self.get_process_working_directory()
59 self.assertTrue(process, PROCESS_IS_VALID)
61 # The stop reason of the thread should be breakpoint.
62 self.expect(
63 "thread list",
64 STOPPED_DUE_TO_BREAKPOINT,
65 substrs=["stopped", "stop reason = breakpoint"],
68 # The breakpoint should have a hit count of 1.
69 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)