[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)
[llvm-project.git] / lldb / test / API / commands / expression / radar_9673664 / TestExprHelpExamples.py
blob5f41b93c58c5cf233da7974d871089b0e6d2bd1b
1 """
2 Test example snippets from the lldb 'help expression' output.
3 """
6 import lldb
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class Radar9673644TestCase(TestBase):
13 def setUp(self):
14 # Call super's setUp().
15 TestBase.setUp(self)
16 # Find the line number to break inside main().
17 self.main_source = "main.c"
18 self.line = line_number(self.main_source, "// Set breakpoint here.")
20 def test_expr_commands(self):
21 """The following expression commands should just work."""
22 self.build()
24 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
26 lldbutil.run_break_set_by_file_and_line(
27 self, self.main_source, self.line, num_expected_locations=1, loc_exact=True
30 self.runCmd("run", RUN_SUCCEEDED)
32 # rdar://problem/9673664 lldb expression evaluation problem
34 self.expect('expr char str[] = "foo"; str[0]', substrs=["'f'"])
35 # runCmd: expr char c[] = "foo"; c[0]
36 # output: (char) $0 = 'f'