For fastcc on x86, let ECX be used as a return register after EAX and EDX
[oota-llvm.git] / test / LLVMC / OptionPreprocessor.td
1 // Test for the OptionPreprocessor and any*.
2 // RUN: ignore tblgen -I %p/../../include --gen-llvmc %s -o %t
3 // RUN: grep W1 %t
4 // RUN: grep W2 %t
5 // RUN: grep W3 %t
6 // RUN: %compile_cxx -fexceptions -x c++ %t
7
8 include "llvm/CompilerDriver/Common.td"
9
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"))
17 ]>;
18
19 def Preprocess : OptionPreprocessor<
20 (case (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
21            (warning "W1"),
22       (and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
23            (warning "W2"),
24       (and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
25            (warning "W3"))
26 >;
27
28 // Shut up warnings...
29 def dummy : Tool<
30 [(in_language "dummy"),
31  (out_language "dummy"),
32  (output_suffix "d"),
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)))
40 ]>;
41
42 def Graph : CompilationGraph<[Edge<"root", "dummy">]>;
43