--- /dev/null
+// Check that the compilation graph can be empty.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s
+
+include "llvm/CompilerDriver/Common.td"
+
+def Graph : CompilationGraph<[]>;
--- /dev/null
+// 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">]>;
--- /dev/null
+// 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<[]>;
--- /dev/null
+// 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">]>;
--- /dev/null
+// Check that the compilation graph is not required.
+// RUN: tblgen -I $srcroot/include --gen-llvmc %s
+
+include "llvm/CompilerDriver/Common.td"
--- /dev/null
+// 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")]>;
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{cpp}]]
}
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{td}]]