diff options
author | Sean Callanan <scallanan@apple.com> | 2016-04-15 00:05:50 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2016-04-15 00:05:50 +0000 |
commit | 5d7ddfda2dd1f61b203ed7bf1589dcafb44d8d7f (patch) | |
tree | 03d61d4fe144516b06e72a179248c7f55e41ea93 /lldb/packages/Python/lldbsuite/test | |
parent | 908dacf91dfbd5ea333386749e746e1a5e133e69 (diff) | |
download | bcm5719-llvm-5d7ddfda2dd1f61b203ed7bf1589dcafb44d8d7f.tar.gz bcm5719-llvm-5d7ddfda2dd1f61b203ed7bf1589dcafb44d8d7f.zip |
Added a testcase for defining and using a block in the expression parser.
<rdar://problem/25738696>
llvm-svn: 266389
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py b/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py index 8f1c3be2283..c5805f40d2a 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py @@ -21,9 +21,8 @@ class BlocksTestCase(TestBase): # Find the line numbers to break at. self.lines.append(line_number('main.c', '// Set breakpoint 0 here.')) self.lines.append(line_number('main.c', '// Set breakpoint 1 here.')) - - @unittest2.expectedFailure("rdar://problem/10413887 - Call blocks in expressions") - def test_expr(self): + + def launch_common(self): self.build() exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -35,6 +34,10 @@ class BlocksTestCase(TestBase): lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True) self.wait_for_breakpoint() + + @unittest2.expectedFailure("rdar://problem/10413887 - Call blocks in expressions") + def test_expr(self): + self.launch_common() self.expect("expression a + b", VARIABLES_DISPLAYED_CORRECTLY, substrs = ["= 7"]) @@ -47,6 +50,13 @@ class BlocksTestCase(TestBase): # This should display correctly. self.expect("expression (int)neg (-12)", VARIABLES_DISPLAYED_CORRECTLY, substrs = ["= 12"]) + + def test_define(self): + self.launch_common() + + self.runCmd("expression int (^$add)(int, int) = ^int(int a, int b) { return a + b; };") + + self.expect("expression $add(2,3)", VARIABLES_DISPLAYED_CORRECTLY, substrs = [" = 5"]) def wait_for_breakpoint(self): if self.is_started == False: |