blob: 8afcd0965a1bc36be9ae0bd60f92eec6c4e541ea [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +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
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00004// RUN: index-test %t1.ast %t2.ast -point-at %S/foo.h:1:14 -print-refs > %t
5// RUN: cat %t | count 4
6// RUN: grep 't1.c:4:19,' %t
7// RUN: grep 't1.c:28:40,' %t
8// RUN: grep 't2.c:6:3,' %t
9// RUN: grep 't2.c:7:12,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000010
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000011// 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
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000014
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000015// 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
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000018
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000019// 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
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000022
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000023// 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
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000026
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000027// 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.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +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
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000039
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000040// RUN: index-test %t1.ast %t2.ast -point-at %S/t1.c:16:7 -print-refs > %t
41// RUN: cat %t | count 1
42// RUN: grep 't1.c:22:3,' %t
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000043
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000044// 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
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000047// RUN: grep 't2.c:10:3,' %t