aboutsummaryrefslogtreecommitdiffstats
path: root/test/LLVMC/HookWithInFile.td
diff options
context:
space:
mode:
Diffstat (limited to 'test/LLVMC/HookWithInFile.td')
-rw-r--r--test/LLVMC/HookWithInFile.td15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/LLVMC/HookWithInFile.td b/test/LLVMC/HookWithInFile.td
new file mode 100644
index 0000000..e15e43c
--- /dev/null
+++ b/test/LLVMC/HookWithInFile.td
@@ -0,0 +1,15 @@
+// Check that a hook can be given $INFILE as an argument.
+// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
+// RUN: FileCheck -input-file %t %s
+// RUN: %compile_cxx -fexceptions -x c++ %t
+
+include "llvm/CompilerDriver/Common.td"
+
+def dummy_tool : Tool<[
+// CHECK: Hook(inFile.c_str())
+(cmd_line "$CALL(Hook, '$INFILE')/path $INFILE"),
+(in_language "dummy"),
+(out_language "dummy")
+]>;
+
+def DummyGraph : CompilationGraph<[SimpleEdge<"root", "dummy_tool">]>;