• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6
7include "llvm/CompilerDriver/Common.td"
8
9// CHECK: std::string MyHook()
10
11def OptList : OptionList<[
12(switch_option "dummy1", (help "none")),
13(switch_option "dummy2", (help "none"))
14]>;
15
16def 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]>;
28
29def DummyGraph : CompilationGraph<[(edge "root", "dummy_tool")]>;
30