3d68d050ee967795013eee63b054634d41dc0bf0
[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 // RUN: %compile_cxx -fexceptions -x c++ %t
6
7 include "llvm/CompilerDriver/Common.td"
8
9 def OptList : OptionList<[
10 (switch_option "dummy1", (help "none"), (init true)),
11 (parameter_option "dummy2", (help "none"), (init "some-string"))
12 ]>;
13
14 def dummy_tool : Tool<[
15 (cmd_line "dummy_cmd $INFILE"),
16 (in_language "dummy_lang"),
17 (out_language "dummy_lang"),
18 (actions (case
19          (switch_on "dummy1"), (forward "dummy1"),
20          (not_empty "dummy2"), (forward "dummy2")))
21 ]>;
22
23 def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;