From: Daniel Dunbar Date: Sun, 13 Sep 2009 01:39:08 +0000 (+0000) Subject: Sink llvm-gcc dependent tests into distinct subdirs. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8a2b012ba75a63b1f7519dedb30ff97b23ec4be2;p=oota-llvm.git Sink llvm-gcc dependent tests into distinct subdirs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81661 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/LLVMC/C++/dash-x.cpp b/test/LLVMC/C++/dash-x.cpp new file mode 100644 index 00000000000..faf8b3072a2 --- /dev/null +++ b/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 + +extern "C" void test(); +extern std::string test2(); + +int main() { + std::cout << "h"; + test(); + std::cout << test2() << '\n'; +} diff --git a/test/LLVMC/C++/dg.exp b/test/LLVMC/C++/dg.exp new file mode 100644 index 00000000000..fc852e30acf --- /dev/null +++ b/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/test/LLVMC/C++/hello.cpp b/test/LLVMC/C++/hello.cpp new file mode 100644 index 00000000000..27c89d66fa7 --- /dev/null +++ b/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 + +int main() { + std::cout << "hello" << '\n'; +} diff --git a/test/LLVMC/C++/together.cpp b/test/LLVMC/C++/together.cpp new file mode 100644 index 00000000000..f1320ca6d03 --- /dev/null +++ b/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(); +} diff --git a/test/LLVMC/C/dg.exp b/test/LLVMC/C/dg.exp new file mode 100644 index 00000000000..a9be28a63cf --- /dev/null +++ b/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/test/LLVMC/C/emit-llvm.c b/test/LLVMC/C/emit-llvm.c new file mode 100644 index 00000000000..38bbba6f0af --- /dev/null +++ b/test/LLVMC/C/emit-llvm.c @@ -0,0 +1,4 @@ +// RUN: llvmc -c -emit-llvm -o - %s | llvm-dis | grep "@f0()" | count 1 + +int f0(void) { +} diff --git a/test/LLVMC/C/hello.c b/test/LLVMC/C/hello.c new file mode 100644 index 00000000000..1cda9c3a340 --- /dev/null +++ b/test/LLVMC/C/hello.c @@ -0,0 +1,12 @@ +/* + * Check that we can compile helloworld + * RUN: llvmc %s -o %t + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} diff --git a/test/LLVMC/C/include.c b/test/LLVMC/C/include.c new file mode 100644 index 00000000000..07ae761d2c8 --- /dev/null +++ b/test/LLVMC/C/include.c @@ -0,0 +1,9 @@ +/* + * Check that the 'include' options work. + * RUN: echo "int x;\n" > %t1.inc + * RUN: llvmc -include %t1.inc -fsyntax-only %s + */ + +int f0(void) { + return x; +} diff --git a/test/LLVMC/C/opt-test.c b/test/LLVMC/C/opt-test.c new file mode 100644 index 00000000000..ed2df52fed7 --- /dev/null +++ b/test/LLVMC/C/opt-test.c @@ -0,0 +1,12 @@ +/* + * Check that the -opt switch works. + * RUN: llvmc %s -opt -o %t + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} diff --git a/test/LLVMC/C/sink.c b/test/LLVMC/C/sink.c new file mode 100644 index 00000000000..3edbf78112e --- /dev/null +++ b/test/LLVMC/C/sink.c @@ -0,0 +1,12 @@ +/* + * Check that the 'sink' options work. + * RUN: llvmc -v -Wall %s -o %t |& grep "Wall" + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} diff --git a/test/LLVMC/C/wall.c b/test/LLVMC/C/wall.c new file mode 100644 index 00000000000..2c72ea69929 --- /dev/null +++ b/test/LLVMC/C/wall.c @@ -0,0 +1,12 @@ +/* + * Check that -Wall works as intended + * RUN: llvmc -Wall %s -o %t + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} diff --git a/test/LLVMC/ObjC++/dg.exp b/test/LLVMC/ObjC++/dg.exp new file mode 100644 index 00000000000..41c3db2af09 --- /dev/null +++ b/test/LLVMC/ObjC++/dg.exp @@ -0,0 +1,5 @@ +load_lib llvm.exp + +if [ llvm_gcc_supports obj-c++ ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]] +} diff --git a/test/LLVMC/ObjC++/hello.mm b/test/LLVMC/ObjC++/hello.mm new file mode 100644 index 00000000000..ff82e4af518 --- /dev/null +++ b/test/LLVMC/ObjC++/hello.mm @@ -0,0 +1,8 @@ +// Test that we can compile Objective-C++ code. +// RUN: llvmc %s -o %t +// RUN: ./%t | grep hello +#include + +int main() { + std::cout << "hello" << '\n'; +} diff --git a/test/LLVMC/ObjC/dg.exp b/test/LLVMC/ObjC/dg.exp new file mode 100644 index 00000000000..18f73a79787 --- /dev/null +++ b/test/LLVMC/ObjC/dg.exp @@ -0,0 +1,5 @@ +load_lib llvm.exp + +if [ llvm_gcc_supports objc ] then { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]] +} diff --git a/test/LLVMC/ObjC/hello.m b/test/LLVMC/ObjC/hello.m new file mode 100644 index 00000000000..1cda9c3a340 --- /dev/null +++ b/test/LLVMC/ObjC/hello.m @@ -0,0 +1,12 @@ +/* + * Check that we can compile helloworld + * RUN: llvmc %s -o %t + * RUN: ./%t | grep hello + */ + +#include + +int main() { + printf("hello\n"); + return 0; +} diff --git a/test/LLVMC/dash-x.cpp b/test/LLVMC/dash-x.cpp deleted file mode 100644 index eb2883d699e..00000000000 --- a/test/LLVMC/dash-x.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// 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 - -extern "C" void test(); -extern std::string test2(); - -int main() { - std::cout << "h"; - test(); - std::cout << test2() << '\n'; -} diff --git a/test/LLVMC/dg.exp b/test/LLVMC/dg.exp new file mode 100644 index 00000000000..f7d275ad8cb --- /dev/null +++ b/test/LLVMC/dg.exp @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]] diff --git a/test/LLVMC/emit-llvm.c b/test/LLVMC/emit-llvm.c deleted file mode 100644 index 38bbba6f0af..00000000000 --- a/test/LLVMC/emit-llvm.c +++ /dev/null @@ -1,4 +0,0 @@ -// RUN: llvmc -c -emit-llvm -o - %s | llvm-dis | grep "@f0()" | count 1 - -int f0(void) { -} diff --git a/test/LLVMC/hello.c b/test/LLVMC/hello.c deleted file mode 100644 index 1cda9c3a340..00000000000 --- a/test/LLVMC/hello.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Check that we can compile helloworld - * RUN: llvmc %s -o %t - * RUN: ./%t | grep hello - */ - -#include - -int main() { - printf("hello\n"); - return 0; -} diff --git a/test/LLVMC/hello.cpp b/test/LLVMC/hello.cpp deleted file mode 100644 index 27c89d66fa7..00000000000 --- a/test/LLVMC/hello.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// Test that we can compile C++ code. -// RUN: llvmc %s -o %t -// RUN: ./%t | grep hello -#include - -int main() { - std::cout << "hello" << '\n'; -} diff --git a/test/LLVMC/hello.m b/test/LLVMC/hello.m deleted file mode 100644 index 1cda9c3a340..00000000000 --- a/test/LLVMC/hello.m +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Check that we can compile helloworld - * RUN: llvmc %s -o %t - * RUN: ./%t | grep hello - */ - -#include - -int main() { - printf("hello\n"); - return 0; -} diff --git a/test/LLVMC/hello.mm b/test/LLVMC/hello.mm deleted file mode 100644 index ff82e4af518..00000000000 --- a/test/LLVMC/hello.mm +++ /dev/null @@ -1,8 +0,0 @@ -// Test that we can compile Objective-C++ code. -// RUN: llvmc %s -o %t -// RUN: ./%t | grep hello -#include - -int main() { - std::cout << "hello" << '\n'; -} diff --git a/test/LLVMC/include.c b/test/LLVMC/include.c deleted file mode 100644 index 07ae761d2c8..00000000000 --- a/test/LLVMC/include.c +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Check that the 'include' options work. - * RUN: echo "int x;\n" > %t1.inc - * RUN: llvmc -include %t1.inc -fsyntax-only %s - */ - -int f0(void) { - return x; -} diff --git a/test/LLVMC/llvmc.exp b/test/LLVMC/llvmc.exp deleted file mode 100644 index f33e24381d1..00000000000 --- a/test/LLVMC/llvmc.exp +++ /dev/null @@ -1,19 +0,0 @@ -load_lib llvm.exp - -if [ llvm_gcc_supports c ] then { - RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c}]] -} - -if [ llvm_gcc_supports c++ ] then { - RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]] -} - -if [ llvm_gcc_supports objc ] then { - RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{m}]] -} - -if [ llvm_gcc_supports obj-c++ ] then { - RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]] -} - -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]] diff --git a/test/LLVMC/opt-test.c b/test/LLVMC/opt-test.c deleted file mode 100644 index ed2df52fed7..00000000000 --- a/test/LLVMC/opt-test.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Check that the -opt switch works. - * RUN: llvmc %s -opt -o %t - * RUN: ./%t | grep hello - */ - -#include - -int main() { - printf("hello\n"); - return 0; -} diff --git a/test/LLVMC/sink.c b/test/LLVMC/sink.c deleted file mode 100644 index 3edbf78112e..00000000000 --- a/test/LLVMC/sink.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Check that the 'sink' options work. - * RUN: llvmc -v -Wall %s -o %t |& grep "Wall" - * RUN: ./%t | grep hello - */ - -#include - -int main() { - printf("hello\n"); - return 0; -} diff --git a/test/LLVMC/together.cpp b/test/LLVMC/together.cpp deleted file mode 100644 index b07250e9d0b..00000000000 --- a/test/LLVMC/together.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// 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(); -} diff --git a/test/LLVMC/wall.c b/test/LLVMC/wall.c deleted file mode 100644 index 2c72ea69929..00000000000 --- a/test/LLVMC/wall.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Check that -Wall works as intended - * RUN: llvmc -Wall %s -o %t - * RUN: ./%t | grep hello - */ - -#include - -int main() { - printf("hello\n"); - return 0; -}