1 """Check that compiler-generated constant values work correctly"""
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
import lldbutil
10 class ConstVariableTestCase(TestBase
):
11 @expectedFailureAll(oslist
=["freebsd", "linux"], compiler
="icc")
12 @expectedFailureAll(archs
=["mips", "mipsel", "mips64", "mips64el"])
15 bugnumber
="llvm.org/pr24489: Name lookup not working correctly on Windows",
17 def test_and_run_command(self
):
18 """Test interpreted and JITted expressions on constant values."""
20 exe
= self
.getBuildArtifact("a.out")
21 self
.runCmd("file " + exe
, CURRENT_EXECUTABLE_SET
)
23 # Break inside the main.
24 lldbutil
.run_break_set_by_symbol(self
, "main", num_expected_locations
=1)
26 self
.runCmd("run", RUN_SUCCEEDED
)
28 # The stop reason of the thread should be breakpoint.
31 STOPPED_DUE_TO_BREAKPOINT
,
32 substrs
=["stopped", "stop reason = breakpoint"],
35 # The breakpoint should have a hit count of 1.
36 lldbutil
.check_breakpoint(self
, bpno
=1, expected_hit_count
=1)
43 "frame variable index",
44 VARIABLES_DISPLAYED_CORRECTLY
,
45 substrs
=["(int32_t) index = 512"],
48 # Try an interpreted expression.
50 "expr (index + 512)", VARIABLES_DISPLAYED_CORRECTLY
, substrs
=["1024"]
53 # Try a JITted expression.
55 "expr (int)getpid(); (index - 256)",
56 VARIABLES_DISPLAYED_CORRECTLY
,