summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-19 17:10:21 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-19 17:10:21 +0000
commitb5c1d07920acd49cf699b149beea345932c419ec (patch)
tree3dea2cba423f9e9590e041e788770f4e0c195dcc /lldb
parent798c5982a032e4e89ead6f71b0f9357900f4eaba (diff)
downloadbcm5719-llvm-b5c1d07920acd49cf699b149beea345932c419ec.tar.gz
bcm5719-llvm-b5c1d07920acd49cf699b149beea345932c419ec.zip
[lit] Make TestConvenienceVariables a cpp file
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. While we figure out how to solve this issue I've turned the source file into a cpp file and added extern c. This should unbreak the bots. llvm-svn: 349642
Diffstat (limited to 'lldb')
-rw-r--r--lldb/lit/Driver/Inputs/convenience.in2
-rw-r--r--lldb/lit/Driver/Inputs/hello.c6
-rw-r--r--lldb/lit/Driver/Inputs/hello.cpp11
-rw-r--r--lldb/lit/Driver/TestConvenienceVariables.test4
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()
OpenPOWER on IntegriCloud