[llvm-commits] [llvm] r50752 - in /llvm/trunk/test/LLVMC: false.c false.cpp false2.cpp hello.cpp

Mikhail Glushenkov foldr at codedgers.com
Tue May 6 11:11:21 PDT 2008


Author: foldr
Date: Tue May  6 13:11:21 2008
New Revision: 50752

URL: http://llvm.org/viewvc/llvm-project?rev=50752&view=rev
Log:
Add two (currently failing) tests.

Added:
    llvm/trunk/test/LLVMC/false.c
    llvm/trunk/test/LLVMC/false.cpp
    llvm/trunk/test/LLVMC/false2.cpp
    llvm/trunk/test/LLVMC/hello.cpp

Added: llvm/trunk/test/LLVMC/false.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/false.c?rev=50752&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/false.c (added)
+++ llvm/trunk/test/LLVMC/false.c Tue May  6 13:11:21 2008
@@ -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'; 
+}

Added: llvm/trunk/test/LLVMC/false.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/false.cpp?rev=50752&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/false.cpp (added)
+++ llvm/trunk/test/LLVMC/false.cpp Tue May  6 13:11:21 2008
@@ -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");
+}
+

Added: llvm/trunk/test/LLVMC/false2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/false2.cpp?rev=50752&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/false2.cpp (added)
+++ llvm/trunk/test/LLVMC/false2.cpp Tue May  6 13:11:21 2008
@@ -0,0 +1,6 @@
+// RUN: ignore
+#include <string>
+
+std::string test2() {
+    return "lo";
+}

Added: llvm/trunk/test/LLVMC/hello.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/hello.cpp?rev=50752&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/hello.cpp (added)
+++ llvm/trunk/test/LLVMC/hello.cpp Tue May  6 13:11:21 2008
@@ -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';
+}





More information about the llvm-commits mailing list