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 -fexceptions -x c++ %t
6 include "llvm/CompilerDriver/Common.td"
8 // CHECK: std::string MyHook()
10 def OptList : OptionList<[
11 (switch_option "dummy1", (help "none")),
12 (switch_option "dummy2", (help "none"))
15 def dummy_tool : Tool<[
16 (cmd_line "dummy_cmd $INFILE"),
17 (in_language "dummy_lang"),
18 (out_language "dummy_lang"),
20 // CHECK: push_back("-arg1")
21 // CHECK: push_back("-arg2")
22 (switch_on "dummy1"), (append_cmd "-arg1 -arg2"),
23 // CHECK: push_back("-arg3")
24 // CHECK: hooks::MyHook()
25 (switch_on "dummy2"), (append_cmd "-arg3 $CALL(MyHook)")))
28 def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;