summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-05-06 18:11:21 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-05-06 18:11:21 +0000
commitceda1734cc33f14077cf48ee1cbe020532a89c81 (patch)
tree84ae9b92a93a5381719c031f5afe23f1fd23d59b /test
parent87416b4cea4748a5d2c40c15b58e1a4a3310cd9f (diff)
downloadllvm-ceda1734cc33f14077cf48ee1cbe020532a89c81.tar.gz
llvm-ceda1734cc33f14077cf48ee1cbe020532a89c81.tar.bz2
llvm-ceda1734cc33f14077cf48ee1cbe020532a89c81.tar.xz
Add two (currently failing) tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/LLVMC/false.c14
-rw-r--r--test/LLVMC/false.cpp17
-rw-r--r--test/LLVMC/false2.cpp6
-rw-r--r--test/LLVMC/hello.cpp8
4 files changed, 45 insertions, 0 deletions
diff --git a/test/LLVMC/false.c b/test/LLVMC/false.c
new file mode 100644
index 0000000000..80e9e03b54
--- /dev/null
+++ b/test/LLVMC/false.c
@@ -0,0 +1,14 @@
+// Test that we can compile .c files as C++ and vice versa
+// RUN: llvmc2 -x c++ %s -x c %p/false.cpp -x lisp -x whatnot -x none %p/false2.cpp -o %t
+// RUN: ./%t | grep hello
+
+#include <iostream>
+
+extern "C" void test();
+extern std::string test2();
+
+int main() {
+ std::cout << "h";
+ test();
+ std::cout << test2() << '\n';
+}
diff --git a/test/LLVMC/false.cpp b/test/LLVMC/false.cpp
new file mode 100644
index 0000000000..d3a7102f8c
--- /dev/null
+++ b/test/LLVMC/false.cpp
@@ -0,0 +1,17 @@
+/* RUN: ignore */
+#include <stdio.h>
+
+/* Make this invalid C++ */
+typedef struct {
+ int i;
+ char c;
+} a;
+
+static a b = { .i = 65, .c = 'r'};
+
+void test() {
+ b.i = 9;
+ fflush(stdout);
+ printf("el");
+}
+
diff --git a/test/LLVMC/false2.cpp b/test/LLVMC/false2.cpp
new file mode 100644
index 0000000000..a02051415d
--- /dev/null
+++ b/test/LLVMC/false2.cpp
@@ -0,0 +1,6 @@
+// RUN: ignore
+#include <string>
+
+std::string test2() {
+ return "lo";
+}
diff --git a/test/LLVMC/hello.cpp b/test/LLVMC/hello.cpp
new file mode 100644
index 0000000000..a3148c3c16
--- /dev/null
+++ b/test/LLVMC/hello.cpp
@@ -0,0 +1,8 @@
+// Test that we can compile C++ code.
+// RUN: llvmc2 %s -o %t
+// RUN: ./%t | grep hello
+#include <iostream>
+
+int main() {
+ std::cout << "hello" << '\n';
+}