[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
This commit is contained in:
Jonas Devlieghere 2018-12-19 17:10:21 +00:00
parent 798c5982a0
commit b5c1d07920
4 changed files with 14 additions and 9 deletions

View File

@ -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)

View File

@ -1,6 +0,0 @@
int printf(const char *format, ...);
int main(int argc, char **argv) {
printf("Hello World\n");
return 0;
}

View File

@ -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;
}
}

View File

@ -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()