aboutsummaryrefslogtreecommitdiff
path: root/lit/Driver/Inputs/hello.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lit/Driver/Inputs/hello.cpp')
-rw-r--r--lit/Driver/Inputs/hello.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lit/Driver/Inputs/hello.cpp b/lit/Driver/Inputs/hello.cpp
new file mode 100644
index 000000000000..1ec0677aeb2c
--- /dev/null
+++ b/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;
+}
+}