diff options
author | Frederic Riss <friss@apple.com> | 2018-11-16 23:07:28 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2018-11-16 23:07:28 +0000 |
commit | d146e337edc10e3cefb52c46f69bc523d0bb40ab (patch) | |
tree | bda723eb4146710b821298a23499830dc7ccc367 /lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp | |
parent | 4fd065a4ac4b1c14dca9a61552627f79d172d002 (diff) | |
download | bcm5719-llvm-d146e337edc10e3cefb52c46f69bc523d0bb40ab.tar.gz bcm5719-llvm-d146e337edc10e3cefb52c46f69bc523d0bb40ab.zip |
Rewrite stop-hook tests as a couple of FileCheck tests
Those tests were using pexpect and being flaky on some of ours bots.
This patch reimplmeents the tests usinf FileCheck, and it also
extends the test coverage to a few more stop-hook options.
llvm-svn: 347109
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp deleted file mode 100644 index c10c1e5ef0d..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//===-- main.c --------------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include <stdio.h> -#include <stdlib.h> - -int a(int); -int b(int); -int c(int); - -int a(int val) -{ - if (val <= 1) - return b(val); - else if (val >= 3) - return c(val); - - return val; -} - -int b(int val) -{ - int rc = c(val); - void *ptr = malloc(1024); - if (!ptr) // Set breakpoint here to test target stop-hook. - return -1; - else - printf("ptr=%p\n", ptr); // We should stop here after stepping. - return rc; // End of the line range for which stop-hook is to be run. -} - -int c(int val) -{ - return val + 3; -} - -int main (int argc, char const *argv[]) -{ - int A1 = a(1); - printf("a(1) returns %d\n", A1); - - int C2 = c(2); // Another breakpoint which is outside of the stop-hook range. - printf("c(2) returns %d\n", C2); - - int A3 = a(3); - printf("a(3) returns %d\n", A3); - - return 0; -} |