08be7cfe8a7af1120a4f2608d985c5f4c7eec857
[oota-llvm.git] / test / LLVMC / OneOrMore.td
1 // Check that (one_or_more) and (zero_or_one) properties work.
2 // The dummy tool and graph are required to silence warnings.
3 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
4 // RUN: grep cl::Optional %t | count 1
5 // RUN: grep cl::OneOrMore %t | count 1
6 // RUN: %compile_cxx -fexceptions -x c++ %t
7
8 include "llvm/CompilerDriver/Common.td"
9
10 def OptList : OptionList<[
11     (prefix_list_option "foo", (one_or_more)),
12     (parameter_list_option "baz", (optional))]>;
13
14 def dummy_tool : Tool<[
15 (cmd_line "dummy_cmd $INFILE"),
16 (in_language "dummy"),
17 (out_language "dummy"),
18 (actions (case
19          (not_empty "foo"), (forward_as "foo", "bar"),
20          (not_empty "baz"), (forward "baz")))
21 ]>;
22
23 def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;