diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-09-13 01:39:08 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-13 01:39:08 +0000 |
| commit | 1b71307d977fad453414a455ab57592a989d679e (patch) | |
| tree | 19f51fcc629d304de0a7718990bf5f7be2015e30 /llvm/test/LLVMC/C++ | |
| parent | 5be66ee27ee7597b8f8d47f9f561e81af8f39b0f (diff) | |
| download | bcm5719-llvm-1b71307d977fad453414a455ab57592a989d679e.tar.gz bcm5719-llvm-1b71307d977fad453414a455ab57592a989d679e.zip | |
Sink llvm-gcc dependent tests into distinct subdirs.
llvm-svn: 81661
Diffstat (limited to 'llvm/test/LLVMC/C++')
| -rw-r--r-- | llvm/test/LLVMC/C++/dash-x.cpp | 14 | ||||
| -rw-r--r-- | llvm/test/LLVMC/C++/dg.exp | 5 | ||||
| -rw-r--r-- | llvm/test/LLVMC/C++/hello.cpp | 8 | ||||
| -rw-r--r-- | llvm/test/LLVMC/C++/together.cpp | 9 |
4 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/LLVMC/C++/dash-x.cpp b/llvm/test/LLVMC/C++/dash-x.cpp new file mode 100644 index 00000000000..faf8b3072a2 --- /dev/null +++ b/llvm/test/LLVMC/C++/dash-x.cpp @@ -0,0 +1,14 @@ +// Test that we can compile .c files as C++ and vice versa +// RUN: llvmc -x c++ %s -x c %p/../test_data/false.cpp -x lisp -x whatnot -x none %p/../test_data/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/llvm/test/LLVMC/C++/dg.exp b/llvm/test/LLVMC/C++/dg.exp new file mode 100644 index 00000000000..fc852e30acf --- /dev/null +++ b/llvm/test/LLVMC/C++/dg.exp @@ -0,0 +1,5 @@ +load_lib llvm.exp + +if [ llvm_gcc_supports c++ ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] +} diff --git a/llvm/test/LLVMC/C++/hello.cpp b/llvm/test/LLVMC/C++/hello.cpp new file mode 100644 index 00000000000..27c89d66fa7 --- /dev/null +++ b/llvm/test/LLVMC/C++/hello.cpp @@ -0,0 +1,8 @@ +// Test that we can compile C++ code. +// RUN: llvmc %s -o %t +// RUN: ./%t | grep hello +#include <iostream> + +int main() { + std::cout << "hello" << '\n'; +} diff --git a/llvm/test/LLVMC/C++/together.cpp b/llvm/test/LLVMC/C++/together.cpp new file mode 100644 index 00000000000..f1320ca6d03 --- /dev/null +++ b/llvm/test/LLVMC/C++/together.cpp @@ -0,0 +1,9 @@ +// Check that we can compile files of different types together. +// RUN: llvmc %s %p/../test_data/together.c -o %t +// RUN: ./%t | grep hello + +extern "C" void test(); + +int main() { + test(); +} |

