[Lldb-commits] [lldb] r349642 - [lit] Make TestConvenienceVariables a cpp file
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Dec 19 09:10:21 PST 2018
Author: jdevlieghere
Date: Wed Dec 19 09:10:21 2018
New Revision: 349642
URL: http://llvm.org/viewvc/llvm-project?rev=349642&view=rev
Log:
[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.
Added:
lldb/trunk/lit/Driver/Inputs/hello.cpp
Removed:
lldb/trunk/lit/Driver/Inputs/hello.c
Modified:
lldb/trunk/lit/Driver/Inputs/convenience.in
lldb/trunk/lit/Driver/TestConvenienceVariables.test
Modified: lldb/trunk/lit/Driver/Inputs/convenience.in
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/convenience.in?rev=349642&r1=349641&r2=349642&view=diff
==============================================================================
--- lldb/trunk/lit/Driver/Inputs/convenience.in (original)
+++ lldb/trunk/lit/Driver/Inputs/convenience.in Wed Dec 19 09:10:21 2018
@@ -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)
Removed: lldb/trunk/lit/Driver/Inputs/hello.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/hello.c?rev=349641&view=auto
==============================================================================
--- lldb/trunk/lit/Driver/Inputs/hello.c (original)
+++ lldb/trunk/lit/Driver/Inputs/hello.c (removed)
@@ -1,6 +0,0 @@
-int printf(const char *format, ...);
-
-int main(int argc, char **argv) {
- printf("Hello World\n");
- return 0;
-}
Added: lldb/trunk/lit/Driver/Inputs/hello.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/Inputs/hello.cpp?rev=349642&view=auto
==============================================================================
--- lldb/trunk/lit/Driver/Inputs/hello.cpp (added)
+++ lldb/trunk/lit/Driver/Inputs/hello.cpp Wed Dec 19 09:10:21 2018
@@ -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;
+}
+}
Modified: lldb/trunk/lit/Driver/TestConvenienceVariables.test
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Driver/TestConvenienceVariables.test?rev=349642&r1=349641&r2=349642&view=diff
==============================================================================
--- lldb/trunk/lit/Driver/TestConvenienceVariables.test (original)
+++ lldb/trunk/lit/Driver/TestConvenienceVariables.test Wed Dec 19 09:10:21 2018
@@ -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 = TestConve
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()
More information about the lldb-commits
mailing list