[llvm-commits] [llvm] r60657 - in /llvm/trunk/test/LLVMC: EmptyCompilationGraph.td ExternOptions.td MultipleCompilationGraphs.td NoActions.td NoCompilationGraph.td TestWarnings.td llvmc.exp

Mikhail Glushenkov foldr at codedgers.com
Sun Dec 7 08:41:51 PST 2008


Author: foldr
Date: Sun Dec  7 10:41:50 2008
New Revision: 60657

URL: http://llvm.org/viewvc/llvm-project?rev=60657&view=rev
Log:
Add tests for tblgen's LLVMC backend.

Added:
    llvm/trunk/test/LLVMC/EmptyCompilationGraph.td
    llvm/trunk/test/LLVMC/ExternOptions.td
    llvm/trunk/test/LLVMC/MultipleCompilationGraphs.td
    llvm/trunk/test/LLVMC/NoActions.td
    llvm/trunk/test/LLVMC/NoCompilationGraph.td
    llvm/trunk/test/LLVMC/TestWarnings.td
Modified:
    llvm/trunk/test/LLVMC/llvmc.exp

Added: llvm/trunk/test/LLVMC/EmptyCompilationGraph.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/EmptyCompilationGraph.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/EmptyCompilationGraph.td (added)
+++ llvm/trunk/test/LLVMC/EmptyCompilationGraph.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,6 @@
+// Check that the compilation graph can be empty.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s
+
+include "llvm/CompilerDriver/Common.td"
+
+def Graph : CompilationGraph<[]>;

Added: llvm/trunk/test/LLVMC/ExternOptions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/ExternOptions.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/ExternOptions.td (added)
+++ llvm/trunk/test/LLVMC/ExternOptions.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,20 @@
+// Check that extern options work.
+// The dummy tool and graph are required to silence warnings.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s | grep extern
+
+include "llvm/CompilerDriver/Common.td"
+
+def OptList : OptionList<[(extern_switch "Wall"),
+    (extern_parameter "std"), (extern_list "L")]>;
+
+def dummy_tool : Tool<[
+(cmd_line "dummy_cmd"),
+(in_language "dummy"),
+(out_language "dummy"),
+(actions (case
+         (switch_on "Wall"), (stop_compilation),
+         (not_empty "std"), (stop_compilation),
+         (not_empty "L"), (stop_compilation)))
+]>;
+
+def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;

Added: llvm/trunk/test/LLVMC/MultipleCompilationGraphs.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/MultipleCompilationGraphs.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/MultipleCompilationGraphs.td (added)
+++ llvm/trunk/test/LLVMC/MultipleCompilationGraphs.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,8 @@
+// Check that multiple compilation graphs are allowed.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s
+
+include "llvm/CompilerDriver/Common.td"
+
+def Graph1 : CompilationGraph<[]>;
+def Graph2 : CompilationGraph<[]>;
+def Graph3 : CompilationGraph<[]>;

Added: llvm/trunk/test/LLVMC/NoActions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/NoActions.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/NoActions.td (added)
+++ llvm/trunk/test/LLVMC/NoActions.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,12 @@
+// Check that tools without associated actions are accepted.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s | grep dummy_tool
+
+include "llvm/CompilerDriver/Common.td"
+
+def dummy_tool : Tool<[
+(cmd_line "dummy_cmd"),
+(in_language "dummy"),
+(out_language "dummy")
+]>;
+
+def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;

Added: llvm/trunk/test/LLVMC/NoCompilationGraph.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/NoCompilationGraph.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/NoCompilationGraph.td (added)
+++ llvm/trunk/test/LLVMC/NoCompilationGraph.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,4 @@
+// Check that the compilation graph is not required.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s
+
+include "llvm/CompilerDriver/Common.td"

Added: llvm/trunk/test/LLVMC/TestWarnings.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/TestWarnings.td?rev=60657&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/TestWarnings.td (added)
+++ llvm/trunk/test/LLVMC/TestWarnings.td Sun Dec  7 10:41:50 2008
@@ -0,0 +1,8 @@
+// Check that the compiler warns about unused options!.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s | grep extern
+// XFAIL: *
+
+include "llvm/CompilerDriver/Common.td"
+
+def OptList : OptionList<[(extern_switch "Wall"),
+    (extern_parameter "std"), (extern_list "L")]>;

Modified: llvm/trunk/test/LLVMC/llvmc.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/llvmc.exp?rev=60657&r1=60656&r2=60657&view=diff

==============================================================================
--- llvm/trunk/test/LLVMC/llvmc.exp (original)
+++ llvm/trunk/test/LLVMC/llvmc.exp Sun Dec  7 10:41:50 2008
@@ -8,3 +8,4 @@
   RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
 }
 
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]]





More information about the llvm-commits mailing list