From 61e88aec10e345617c054125c4fdfdc7a692be47 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 13 Sep 2009 01:39:08 +0000 Subject: 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 --- test/LLVMC/C++/dash-x.cpp | 14 ++++++++++++++ test/LLVMC/C++/dg.exp | 5 +++++ test/LLVMC/C++/hello.cpp | 8 ++++++++ test/LLVMC/C++/together.cpp | 9 +++++++++ test/LLVMC/C/dg.exp | 5 +++++ test/LLVMC/C/emit-llvm.c | 4 ++++ test/LLVMC/C/hello.c | 12 ++++++++++++ test/LLVMC/C/include.c | 9 +++++++++ test/LLVMC/C/opt-test.c | 12 ++++++++++++ test/LLVMC/C/sink.c | 12 ++++++++++++ test/LLVMC/C/wall.c | 12 ++++++++++++ test/LLVMC/ObjC++/dg.exp | 5 +++++ test/LLVMC/ObjC++/hello.mm | 8 ++++++++ test/LLVMC/ObjC/dg.exp | 5 +++++ test/LLVMC/ObjC/hello.m | 12 ++++++++++++ test/LLVMC/dash-x.cpp | 14 -------------- test/LLVMC/dg.exp | 3 +++ test/LLVMC/emit-llvm.c | 4 ---- test/LLVMC/hello.c | 12 ------------ test/LLVMC/hello.cpp | 8 -------- test/LLVMC/hello.m | 12 ------------ test/LLVMC/hello.mm | 8 -------- test/LLVMC/include.c | 9 --------- test/LLVMC/llvmc.exp | 19 ------------------- test/LLVMC/opt-test.c | 12 ------------ test/LLVMC/sink.c | 12 ------------ test/LLVMC/together.cpp | 9 --------- test/LLVMC/wall.c | 12 ------------ 28 files changed, 135 insertions(+), 131 deletions(-) create mode 100644 test/LLVMC/C++/dash-x.cpp create mode 100644 test/LLVMC/C++/dg.exp create mode 100644 test/LLVMC/C++/hello.cpp create mode 100644 test/LLVMC/C++/together.cpp create mode 100644 test/LLVMC/C/dg.exp create mode 100644 test/LLVMC/C/emit-llvm.c create mode 100644 test/LLVMC/C/hello.c create mode 100644 test/LLVMC/C/include.c create mode 100644 test/LLVMC/C/opt-test.c create mode 100644 test/LLVMC/C/sink.c create mode 100644 test/LLVMC/C/wall.c create mode 100644 test/LLVMC/ObjC++/dg.exp create mode 100644 test/LLVMC/ObjC++/hello.mm create mode 100644 test/LLVMC/ObjC/dg.exp create mode 100644 test/LLVMC/ObjC/hello.m delete mode 100644 test/LLVMC/dash-x.cpp create mode 100644 test/LLVMC/dg.exp delete mode 100644 test/LLVMC/emit-llvm.c delete mode 100644 test/LLVMC/hello.c delete mode 100644 test/LLVMC/hello.cpp delete mode 100644 test/LLVMC/hello.m delete mode 100644 test/LLVMC/hello.mm delete mode 100644 test/LLVMC/include.c delete mode 100644 test/LLVMC/llvmc.exp delete mode 100644 test/LLVMC/opt-test.c delete mode 100644 test/LLVMC/sink.c delete mode 100644 test/LLVMC/together.cpp delete mode 100644 test/LLVMC/wall.c (limited to 'test') diff --git a/test/LLVMC/C++/dash-x.cpp b/test/LLVMC/C++/dash-x.cpp new file mode 100644 index 0000000..faf8b30 --- /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 0000000..fc852e3 --- /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 0000000..27c89d6 --- /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 0000000..f1320ca --- /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 0000000..a9be28a --- /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 0000000..38bbba6 --- /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 0000000..1cda9c3 --- /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 0000000..07ae761 --- /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 0000000..ed2df52 --- /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 0000000..3edbf78 --- /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 0000000..2c72ea6 --- /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 0000000..41c3db2 --- /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 0000000..ff82e4a --- /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 0000000..18f73a7 --- /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 0000000..1cda9c3 --- /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 eb2883d..0000000 --- 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 0000000..f7d275a --- /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 38bbba6..0000000 --- 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 1cda9c3..0000000 --- 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 27c89d6..0000000 --- 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 1cda9c3..0000000 --- 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 ff82e4a..0000000 --- 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 07ae761..0000000 --- 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 f33e243..0000000 --- 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 ed2df52..0000000 --- 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 3edbf78..0000000 --- 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 b07250e..0000000 --- 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 2c72ea6..0000000 --- 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; -} -- cgit v1.1