aboutsummaryrefslogtreecommitdiff
path: root/test/Index/find-defs.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Index/find-defs.c')
-rw-r--r--test/Index/find-defs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Index/find-defs.c b/test/Index/find-defs.c
new file mode 100644
index 000000000000..0e63ae760047
--- /dev/null
+++ b/test/Index/find-defs.c
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fblocks -emit-pch %S/t1.c -o %t1.ast &&
+// RUN: clang-cc -fblocks -emit-pch %S/t2.c -o %t2.ast &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-defs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't2.c:3:5,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-defs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't1.c:3:6,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-defs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't2.c:5:6,' %t &&
+
+// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:8:7 -print-defs > %t &&
+// RUN: cat %t | count 1 &&
+// RUN: grep 't2.c:5:6,' %t