s/requires/REQUIRES to fix the test on release build
[llvm-project.git] / lldb / test / API / lang / cpp / inlines / TestInlines.py
blob06b4dee67928c54484f4c4129117d2dc17a79854
1 """Test variable lookup when stopped in inline functions."""
4 import lldb
5 from lldbsuite.test.decorators import *
6 from lldbsuite.test.lldbtest import *
7 from lldbsuite.test import lldbutil
10 class InlinesTestCase(TestBase):
11 def setUp(self):
12 # Call super's setUp().
13 TestBase.setUp(self)
14 # Find the line number to break inside main().
15 self.line = line_number("inlines.cpp", "// Set break point at this line.")
17 def test(self):
18 """Test that local variables are visible in expressions."""
19 self.build()
20 self.runToBreakpoint()
22 # Check that 'frame variable' finds a variable
23 self.expect(
24 "frame variable inner_input",
25 VARIABLES_DISPLAYED_CORRECTLY,
26 startstr="(int) inner_input =",
29 # Check that 'expr' finds a variable
30 self.expect(
31 "expr inner_input", VARIABLES_DISPLAYED_CORRECTLY, startstr="(int) $0 ="
34 def runToBreakpoint(self):
35 exe = self.getBuildArtifact("a.out")
36 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
38 # Break inside the main.
39 lldbutil.run_break_set_by_file_and_line(
40 self, "inlines.cpp", self.line, num_expected_locations=2, loc_exact=True
43 self.runCmd("run", RUN_SUCCEEDED)
45 # The stop reason of the thread should be breakpoint.
46 self.expect(
47 "thread list",
48 STOPPED_DUE_TO_BREAKPOINT,
49 substrs=["stopped", "stop reason = breakpoint"],
52 # The breakpoint should have a hit count of 1.
53 lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)