d9a4fc1c1b12418792f633ff36bc6d42b25f466e
[oota-llvm.git] / test / LLVMC / Init.td
1 // Check that (init true/false) and (init "str") work.
2 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
3 // RUN: grep cl::init(\\"some-string\\") %t | count 1
4 // RUN: grep cl::init(true) %t | count 1
5
6 include "llvm/CompilerDriver/Common.td"
7
8 def OptList : OptionList<[
9 (switch_option "dummy1", (help "none"), (init true)),
10 (parameter_option "dummy2", (help "none"), (init "some-string"))
11 ]>;
12
13 def dummy_tool : Tool<[
14 (cmd_line "dummy_cmd $INFILE"),
15 (in_language "dummy_lang"),
16 (out_language "dummy_lang"),
17 (actions (case
18          (switch_on "dummy1"), (forward "dummy1"),
19          (not_empty "dummy2"), (forward "dummy2")))
20 ]>;
21
22 def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;