[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / lldb / test / API / functionalities / dead-strip / TestDeadStrip.py
blobedaf609e98618e79092c3e5d5bc2baaedff901f2
1 """
2 Test that breakpoint works correctly in the presence of dead-code stripping.
3 """
6 import lldb
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class DeadStripTestCase(TestBase):
13 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr44429")
14 def test(self):
15 """Test breakpoint works correctly with dead-code stripping."""
16 self.build()
17 exe = self.getBuildArtifact("a.out")
18 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
20 # Break by function name f1 (live code).
21 lldbutil.run_break_set_by_symbol(
22 self, "f1", num_expected_locations=1, module_name="a.out"
25 # Break by function name f2 (dead code).
26 lldbutil.run_break_set_by_symbol(
27 self, "f2", num_expected_locations=0, module_name="a.out"
30 # Break by function name f3 (live code).
31 lldbutil.run_break_set_by_symbol(
32 self, "f3", num_expected_locations=1, module_name="a.out"
35 self.runCmd("run", RUN_SUCCEEDED)
37 # The stop reason of the thread should be breakpoint (breakpoint #1).
38 self.expect(
39 "thread list",
40 STOPPED_DUE_TO_BREAKPOINT,
41 substrs=["stopped", "a.out`f1", "stop reason = breakpoint"],
44 # The breakpoint should have a hit count of 1.
45 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
47 self.runCmd("continue")
49 # The stop reason of the thread should be breakpoint (breakpoint #3).
50 self.expect(
51 "thread list",
52 STOPPED_DUE_TO_BREAKPOINT,
53 substrs=["stopped", "a.out`f3", "stop reason = breakpoint"],
56 # The breakpoint should have a hit count of 1.
57 lldbutil.check_breakpoint(self, bpno=3, expected_hit_count=1)