blob: 1b58b375277301ec8cbdd50e83b658bbdff28d24 [file] [log] [blame]
Daniel Dunbar218e0b72009-07-30 02:43:05 +00001// RUN: clang-cc -fblocks -emit-pch %S/t1.c -o %t1.ast &&
2// RUN: clang-cc -fblocks -emit-pch %S/t2.c -o %t2.ast &&
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +00003
4// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs > %t &&
Argyrios Kyrtzidisad6e5d12009-07-29 23:40:48 +00005// RUN: cat %t | count 4 &&
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +00006// RUN: grep 't1.c:4:19,' %t &&
Argyrios Kyrtzidisad6e5d12009-07-29 23:40:48 +00007// RUN: grep 't1.c:28:40,' %t &&
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +00008// RUN: grep 't2.c:6:3,' %t &&
9// RUN: grep 't2.c:7:12,' %t &&
10
11// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:3:9 -print-refs > %t &&
12// RUN: cat %t | count 1 &&
13// RUN: grep 't2.c:7:3,' %t &&
14
15// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:4:9 -print-refs > %t &&
16// RUN: cat %t | count 1 &&
17// RUN: grep 't1.c:8:3,' %t &&
18
19// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:3:22 -print-refs > %t &&
20// RUN: cat %t | count 1 &&
21// RUN: grep 't1.c:6:17,' %t &&
22
23// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:4:11 -print-refs > %t &&
24// RUN: cat %t | count 1 &&
25// RUN: grep 't1.c:6:5,' %t &&
26
27// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:5:30 -print-refs > %t &&
28// RUN: cat %t | count 3 &&
29// RUN: grep 't1.c:5:27,' %t &&
30// RUN: grep 't1.c:5:44,' %t &&
31// RUN: grep 't1.c:6:26,' %t &&
Argyrios Kyrtzidis12585542009-07-14 03:18:40 +000032
33// field test
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000034
Argyrios Kyrtzidis12585542009-07-14 03:18:40 +000035// FIXME: References point at the start of MemberExpr, make them point at the field instead.
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000036// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:12:7 -print-refs > %t &&
37// RUN: cat %t | count 1 &&
38// RUN: grep 't1.c:21:3,' %t &&
39
40// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs > %t &&
41// RUN: cat %t | count 1 &&
Daniel Dunbar025f80d2009-07-25 11:27:37 +000042// RUN: grep 't1.c:22:3,' %t &&
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000043
44// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:7:11 -print-refs > %t &&
45// RUN: cat %t | count 2 &&
46// RUN: grep 't1.c:25:3,' %t &&
47// RUN: grep 't2.c:10:3,' %t