1 // Test for the OptionPreprocessor and any*.
2 // RUN: ignore tblgen -I %p/../../include --gen-llvmc %s -o %t
7 include "llvm/CompilerDriver/Common.td"
9 def OptList : OptionList<[
10 (switch_option "foo", (help "dummy")),
11 (switch_option "bar", (help "dummy")),
12 (switch_option "baz", (help "dummy")),
13 (parameter_option "foo_p", (help "dummy")),
14 (parameter_option "bar_p", (help "dummy")),
15 (parameter_option "baz_p", (help "dummy"))
18 def Preprocess : OptionPreprocessor<
19 (case (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
21 (and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
23 (and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
27 // Shut up warnings...
29 [(in_language "dummy"),
30 (out_language "dummy"),
32 (cmd_line "dummy $INFILE -o $OUTFILE"),
33 (actions (case (switch_on "foo"), (error),
34 (switch_on "bar"), (error),
35 (switch_on "baz"), (error),
36 (not_empty "foo_p"), (error),
37 (not_empty "bar_p"), (error),
38 (not_empty "baz_p"), (error)))
41 def Graph : CompilationGraph<[Edge<"root", "dummy">]>;