1 // Test for the OptionPreprocessor and any*.
2 // RUN: ignore tblgen -I %p/../../include --gen-llvmc %s -o %t
6 // RUN: %compile_cxx -fexceptions -x c++ %t
8 include "llvm/CompilerDriver/Common.td"
10 def OptList : OptionList<[
11 (switch_option "foo", (help "dummy")),
12 (switch_option "bar", (help "dummy")),
13 (switch_option "baz", (help "dummy")),
14 (parameter_option "foo_p", (help "dummy")),
15 (parameter_option "bar_p", (help "dummy")),
16 (parameter_option "baz_p", (help "dummy"))
19 def Preprocess : OptionPreprocessor<
20 (case (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
22 (and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
24 (and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
28 // Shut up warnings...
30 [(in_language "dummy"),
31 (out_language "dummy"),
33 (cmd_line "dummy $INFILE -o $OUTFILE"),
34 (actions (case (switch_on "foo"), (error),
35 (switch_on "bar"), (error),
36 (switch_on "baz"), (error),
37 (not_empty "foo_p"), (error),
38 (not_empty "bar_p"), (error),
39 (not_empty "baz_p"), (error)))
42 def Graph : CompilationGraph<[Edge<"root", "dummy">]>;