Heuristic: If the number of operands in the alias are more than the number of
[llvm/stm8.git] / test / LLVMC / AppendCmdHook.td
blobc85f002e6e8b4c7de1d08bebc6efd2da72870f59
1 // Check that hooks can be invoked from 'append_cmd'.
2 // RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
3 // RUN: FileCheck -input-file %t %s
4 // RUN: %compile_cxx %t
5 // XFAIL: vg_leak
7 include "llvm/CompilerDriver/Common.td"
9 // CHECK: std::string MyHook()
11 def OptList : OptionList<[
12 (switch_option "dummy1", (help "none")),
13 (switch_option "dummy2", (help "none"))
14 ]>;
16 def dummy_tool : Tool<[
17 (command "dummy_cmd"),
18 (in_language "dummy_lang"),
19 (out_language "dummy_lang"),
20 (actions (case
21          // CHECK: , "-arg1"));
22          // CHECK: , "-arg2"));
23          (switch_on "dummy1"), (append_cmd "-arg1 -arg2"),
24          // CHECK: , "-arg3"));
25          // CHECK: hooks::MyHook()
26          (switch_on "dummy2"), (append_cmd "-arg3 $CALL(MyHook)")))
27 ]>;
29 def DummyGraph : CompilationGraph<[(edge "root", "dummy_tool")]>;