diff options
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/lit/Driver/Inputs/convenience.in | 2 | ||||
| -rw-r--r-- | lldb/lit/Driver/Inputs/hello.c | 6 | ||||
| -rw-r--r-- | lldb/lit/Driver/Inputs/hello.cpp | 11 | ||||
| -rw-r--r-- | lldb/lit/Driver/TestConvenienceVariables.test | 4 |
4 files changed, 14 insertions, 9 deletions
diff --git a/lldb/lit/Driver/Inputs/convenience.in b/lldb/lit/Driver/Inputs/convenience.in index dbbe2f7978d..6d5603c4351 100644 --- a/lldb/lit/Driver/Inputs/convenience.in +++ b/lldb/lit/Driver/Inputs/convenience.in @@ -1,4 +1,4 @@ -breakpoint set -f hello.c -p Hello +breakpoint set -f hello.cpp -p Hello run script print(lldb.debugger) script print(lldb.target) diff --git a/lldb/lit/Driver/Inputs/hello.c b/lldb/lit/Driver/Inputs/hello.c deleted file mode 100644 index ad8e6f39fa8..00000000000 --- a/lldb/lit/Driver/Inputs/hello.c +++ /dev/null @@ -1,6 +0,0 @@ -int printf(const char *format, ...); - -int main(int argc, char **argv) { - printf("Hello World\n"); - return 0; -} diff --git a/lldb/lit/Driver/Inputs/hello.cpp b/lldb/lit/Driver/Inputs/hello.cpp new file mode 100644 index 00000000000..1ec0677aeb2 --- /dev/null +++ b/lldb/lit/Driver/Inputs/hello.cpp @@ -0,0 +1,11 @@ +// The build.py script always runs the compiler in C++ mode, regardless of the +// file extension. This results in mangled names presented to the linker which +// in turn cannot find the printf symbol. +extern "C" { +int printf(const char *format, ...); + +int main(int argc, char **argv) { + printf("Hello World\n"); + return 0; +} +} diff --git a/lldb/lit/Driver/TestConvenienceVariables.test b/lldb/lit/Driver/TestConvenienceVariables.test index eac57af3a3d..99536e4c029 100644 --- a/lldb/lit/Driver/TestConvenienceVariables.test +++ b/lldb/lit/Driver/TestConvenienceVariables.test @@ -1,4 +1,4 @@ -RUN: %build %p/Inputs/hello.c -o %t +RUN: %build %p/Inputs/hello.cpp -o %t RUN: %lldb %t -s %p/Inputs/convenience.in -o quit | FileCheck %s script print(lldb.debugger) @@ -15,7 +15,7 @@ CHECK-SAME: executable = TestConvenienceVariables.test CHECK: script print(lldb.thread.GetStopDescription(100)) CHECK: breakpoint 1.1 CHECK: script lldb.frame.GetLineEntry().GetLine() -CHECK: 4 +CHECK: 8 CHECK: script lldb.frame.GetLineEntry().GetFileSpec().GetFilename() CHECK: hello.c CHECK: script lldb.frame.GetFunctionName() |

