Simplify LLVMC tests.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 13 Sep 2009 01:36:19 +0000 (01:36 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 13 Sep 2009 01:36:19 +0000 (01:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81659 91177308-0d34-0410-b5e6-96231b3b80d8

test/LLVMC/dash-x.cpp [new file with mode: 0644]
test/LLVMC/false.c [deleted file]
test/LLVMC/llvmc.exp
test/LLVMC/test_data/false.c [new file with mode: 0644]

diff --git a/test/LLVMC/dash-x.cpp b/test/LLVMC/dash-x.cpp
new file mode 100644 (file)
index 0000000..eb2883d
--- /dev/null
@@ -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/test/LLVMC/false.c b/test/LLVMC/false.c
deleted file mode 100644 (file)
index eb2883d..0000000
+++ /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 <iostream>
-
-extern "C" void test();
-extern std::string test2();
-
-int main() {
-    std::cout << "h";
-    test();
-    std::cout << test2() << '\n';
-}
index fd5a0466ad8bac2e1c16e17c79b93ba77a6f5db4..f33e24381d18fe94bde78f5b6ead8e6f5058268c 100644 (file)
@@ -1,19 +1,11 @@
 load_lib llvm.exp
 
-# 'false.c' is really C++, so it must be treated differently.
-set special_file "$srcdir/$subdir/false.c"
-
 if [ llvm_gcc_supports c ] then {
-    # tcl seems to lack 'filter' which would've made this easier...
-    set temp [glob -nocomplain $srcdir/$subdir/*.{c}]
-    set c_files [list]
-    foreach f $temp { if {$f != $special_file} {lappend c_files $f}}
-
-    RunLLVMTests [lsort $c_files]
+    RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{c}]]
 }
 
 if [ llvm_gcc_supports c++ ] then {
-    RunLLVMTests [lsort [concat [glob -nocomplain $srcdir/$subdir/*.{cpp}] $special_file]]
+    RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
 }
 
 if [ llvm_gcc_supports objc ] then {
diff --git a/test/LLVMC/test_data/false.c b/test/LLVMC/test_data/false.c
new file mode 100644 (file)
index 0000000..98842fe
--- /dev/null
@@ -0,0 +1,10 @@
+#include <iostream>
+
+extern "C" void test();
+extern std::string test2();
+
+int main() {
+    std::cout << "h";
+    test();
+    std::cout << test2() << '\n';
+}