diff options
Diffstat (limited to 'lldb/lit')
-rw-r--r-- | lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in | 6 | ||||
-rw-r--r-- | lldb/lit/Reproducer/Inputs/GDBRemoteReplay.in | 5 | ||||
-rw-r--r-- | lldb/lit/Reproducer/Inputs/simple.c | 19 | ||||
-rw-r--r-- | lldb/lit/Reproducer/TestDriverOptions.test | 7 | ||||
-rw-r--r-- | lldb/lit/Reproducer/TestGDBRemoteRepro.test | 26 |
5 files changed, 63 insertions, 0 deletions
diff --git a/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in b/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in new file mode 100644 index 00000000000..8df7ca42fee --- /dev/null +++ b/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in @@ -0,0 +1,6 @@ +breakpoint set -f simple.c -l 13 +run +bt +cont +reproducer status +reproducer generate diff --git a/lldb/lit/Reproducer/Inputs/GDBRemoteReplay.in b/lldb/lit/Reproducer/Inputs/GDBRemoteReplay.in new file mode 100644 index 00000000000..1364c7e7276 --- /dev/null +++ b/lldb/lit/Reproducer/Inputs/GDBRemoteReplay.in @@ -0,0 +1,5 @@ +reproducer status +breakpoint set -f simple.c -l 13 +run +bt +cont diff --git a/lldb/lit/Reproducer/Inputs/simple.c b/lldb/lit/Reproducer/Inputs/simple.c new file mode 100644 index 00000000000..a4585b380ca --- /dev/null +++ b/lldb/lit/Reproducer/Inputs/simple.c @@ -0,0 +1,19 @@ +//===-- 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> + +void foo() { + printf("testing\n"); +} + +int main (int argc, char const *argv[]) { + foo(); + return 0; +} diff --git a/lldb/lit/Reproducer/TestDriverOptions.test b/lldb/lit/Reproducer/TestDriverOptions.test new file mode 100644 index 00000000000..d7a076841d9 --- /dev/null +++ b/lldb/lit/Reproducer/TestDriverOptions.test @@ -0,0 +1,7 @@ +# Check that errors are propagated to the driver. + +# RUN: not %lldb --capture /bogus 2>&1 | FileCheck %s --check-prefix CAPTURE +# RUN: not %lldb --replay /bogus 2>&1 | FileCheck %s --check-prefix REPLAY + +# CAPTURE: unable to create reproducer directory +# REPLAY: unable to load reproducer index diff --git a/lldb/lit/Reproducer/TestGDBRemoteRepro.test b/lldb/lit/Reproducer/TestGDBRemoteRepro.test new file mode 100644 index 00000000000..6a6bdd780a8 --- /dev/null +++ b/lldb/lit/Reproducer/TestGDBRemoteRepro.test @@ -0,0 +1,26 @@ +# UNSUPPORTED: system-windows, system-freebsd + +# This tests the replaying of GDB remote packets. +# +# We issue the same commands and ensure the output is identical to the original +# process. To ensure we're not actually running the original binary we check +# that the string "testing" is not printed. + +# RUN: %clang %S/Inputs/simple.c -g -o %t.out +# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteCapture.in --capture %T/reproducer -- %t.out | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE +# RUN: %lldb -x -b -s %S/Inputs/GDBRemoteReplay.in --replay %T/reproducer -- %t.out | FileCheck %s --check-prefix CHECK --check-prefix REPLAY + +# CHECK: Breakpoint 1 +# CHECK: Process {{.*}} stopped +# CHECK: Process {{.*}} launched +# CHECK: thread {{.*}} stop reason = breakpoint +# CHECK: frame {{.*}} simple.c + +# CAPTURE: testing +# REPLAY-NOT: testing + +# CHECK: Process {{.*}} resuming +# CHECK: Process {{.*}} exited + +# CAPTURE: Reproducer is in capture mode. +# CAPTURE: Reproducer written |