mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Add a test for OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6efba21342
commit
14cb2a2327
42
test/LLVMC/OptionPreprocessor.td
Normal file
42
test/LLVMC/OptionPreprocessor.td
Normal file
@ -0,0 +1,42 @@
|
||||
// Test for the OptionPreprocessor and any*.
|
||||
// RUN: ignore tblgen -I %p/../../include --gen-llvmc %s -o %t
|
||||
// RUN: grep W1 %t
|
||||
// RUN: grep W2 %t
|
||||
// RUN: grep W3 %t
|
||||
|
||||
include "llvm/CompilerDriver/Common.td"
|
||||
|
||||
def OptList : OptionList<[
|
||||
(switch_option "foo", (help "dummy")),
|
||||
(switch_option "bar", (help "dummy")),
|
||||
(switch_option "baz", (help "dummy")),
|
||||
(parameter_option "foo_p", (help "dummy")),
|
||||
(parameter_option "bar_p", (help "dummy")),
|
||||
(parameter_option "baz_p", (help "dummy"))
|
||||
]>;
|
||||
|
||||
def Preprocess : OptionPreprocessor<
|
||||
(case (and (switch_on "foo"), (any_switch_on ["bar", "baz"])),
|
||||
(warning "W1"),
|
||||
(and (switch_on ["foo", "bar"]), (any_empty ["foo_p", "bar_p"])),
|
||||
(warning "W2"),
|
||||
(and (empty ["foo_p", "bar_p"]), (any_not_empty ["baz_p"])),
|
||||
(warning "W3"))
|
||||
>;
|
||||
|
||||
// Shut up warnings...
|
||||
def dummy : Tool<
|
||||
[(in_language "dummy"),
|
||||
(out_language "dummy"),
|
||||
(output_suffix "d"),
|
||||
(cmd_line "dummy $INFILE -o $OUTFILE"),
|
||||
(actions (case (switch_on "foo"), (error),
|
||||
(switch_on "bar"), (error),
|
||||
(switch_on "baz"), (error),
|
||||
(not_empty "foo_p"), (error),
|
||||
(not_empty "bar_p"), (error),
|
||||
(not_empty "baz_p"), (error)))
|
||||
]>;
|
||||
|
||||
def Graph : CompilationGraph<[Edge<"root", "dummy">]>;
|
||||
|
Loading…
Reference in New Issue
Block a user