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
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"))
16 def dummy_tool : Tool<[
17 (command "dummy_cmd"),
18 (in_language "dummy_lang"),
19 (out_language "dummy_lang"),
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)")))
29 def DummyGraph : CompilationGraph<[(edge "root", "dummy_tool")]>;