[llvm-commits] [llvm] r91259 - /llvm/trunk/test/LLVMC/Init.td

Mikhail Glushenkov foldr at codedgers.com
Sun Dec 13 20:06:38 PST 2009


Author: foldr
Date: Sun Dec 13 22:06:38 2009
New Revision: 91259

URL: http://llvm.org/viewvc/llvm-project?rev=91259&view=rev
Log:
Add a test for the 'init' option property.

Added:
    llvm/trunk/test/LLVMC/Init.td

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

==============================================================================
--- llvm/trunk/test/LLVMC/Init.td (added)
+++ llvm/trunk/test/LLVMC/Init.td Sun Dec 13 22:06:38 2009
@@ -0,0 +1,22 @@
+// Check that (init true/false) and (init "str") work.
+// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
+// RUN: grep cl::init("some-string") %t
+// RUN: grep cl::init(true) %t
+
+include "llvm/CompilerDriver/Common.td"
+
+def OptList : OptionList<[
+(switch_option "dummy1", (help "none"), (init true)),
+(parameter_option "dummy2", (help "none"), (init "some-string"))
+]>;
+
+def dummy_tool : Tool<[
+(cmd_line "dummy_cmd $INFILE"),
+(in_language "dummy_lang"),
+(out_language "dummy_lang"),
+(actions (case
+         (switch_on "dummy1"), (forward "dummy1"),
+         (not_empty "dummy2"), (forward "dummy2")))
+]>;
+
+def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;





More information about the llvm-commits mailing list