Add tests for tblgen's LLVMC backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60657 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2008-12-07 16:41:50 +00:00
parent f915253dfc
commit 15dcc2a15b
7 changed files with 59 additions and 0 deletions

View File

@ -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<[]>;

View File

@ -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">]>;

View File

@ -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<[]>;

12
test/LLVMC/NoActions.td Normal file
View File

@ -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">]>;

View File

@ -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"

View File

@ -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")]>;

View File

@ -8,3 +8,4 @@ if [ llvm_gcc_supports c++ ] then {
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
}
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]]