summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2008-05-06 17:24:54 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2008-05-06 17:24:54 +0000
commit3c30e6c6536b493998ac00c0e4b801a55d21194e (patch)
tree82435098c9e7f24cd3f82cd65ffc35473c1c2977 /test
parentb96cb6082784fcf58349fa37e8d4a7cd2030c9cb (diff)
downloadllvm-3c30e6c6536b493998ac00c0e4b801a55d21194e.tar.gz
llvm-3c30e6c6536b493998ac00c0e4b801a55d21194e.tar.bz2
llvm-3c30e6c6536b493998ac00c0e4b801a55d21194e.tar.xz
First small tests for llvmc2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/LLVMC/dg.exp3
-rw-r--r--test/LLVMC/hello.c12
-rw-r--r--test/LLVMC/together.cpp10
-rw-r--r--test/LLVMC/together1.c9
4 files changed, 34 insertions, 0 deletions
diff --git a/test/LLVMC/dg.exp b/test/LLVMC/dg.exp
new file mode 100644
index 0000000000..22ecaecbd7
--- /dev/null
+++ b/test/LLVMC/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c,cpp}]]
diff --git a/test/LLVMC/hello.c b/test/LLVMC/hello.c
new file mode 100644
index 0000000000..bf917bcdea
--- /dev/null
+++ b/test/LLVMC/hello.c
@@ -0,0 +1,12 @@
+/*
+ * Check that we can compile helloworld
+ * RUN: llvmc2 %s -o %t
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+ printf("hello\n");
+ return 0;
+}
diff --git a/test/LLVMC/together.cpp b/test/LLVMC/together.cpp
new file mode 100644
index 0000000000..62ff821154
--- /dev/null
+++ b/test/LLVMC/together.cpp
@@ -0,0 +1,10 @@
+// Check that we can compile files of different types together.
+// TOFIX: compiling files with same names should work.
+// RUN: llvmc2 %s %p/together1.c -o %t
+// RUN: ./%t | grep hello
+
+extern "C" void test();
+
+int main() {
+ test();
+}
diff --git a/test/LLVMC/together1.c b/test/LLVMC/together1.c
new file mode 100644
index 0000000000..1b9b5f67fb
--- /dev/null
+++ b/test/LLVMC/together1.c
@@ -0,0 +1,9 @@
+/*
+ * RUN: ignore
+ */
+
+#include <stdio.h>
+
+void test() {
+ printf("hello\n");
+}