2 Test example snippets from the lldb 'help expression' output.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class Radar9673644TestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 # Call super's setUp().
20 # Find the line number to break inside main().
21 self.main_source = "main.c"
22 self.line = line_number(self.main_source, '// Set breakpoint here.')
24 def test_expr_commands(self):
25 """The following expression commands should just work."""
28 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
30 lldbutil.run_break_set_by_file_and_line(
34 num_expected_locations=1,
37 self.runCmd("run", RUN_SUCCEEDED)
39 # rdar://problem/9673664 lldb expression evaluation problem
41 self.expect('expr char str[] = "foo"; str[0]',
43 # runCmd: expr char c[] = "foo"; c[0]
44 # output: (char) $0 = 'f'