blob: 5209e141b629d685389f64d0565f21405052f85b [file] [log] [blame]
Daniel Dunbar1787b702009-11-08 01:46:19 +00001// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t1.c -o %t1.ast
2// RUN: clang-cc -fblocks -emit-pch %S/Inputs/t2.c -o %t2.ast
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +00003
Daniel Dunbar1787b702009-11-08 01:46:19 +00004// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:1:14 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// 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 Dunbar1787b702009-11-08 01:46:19 +000011// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:3:9 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000012// RUN: cat %t | count 1
13// RUN: grep 't2.c:7:3,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000014
Daniel Dunbar1787b702009-11-08 01:46:19 +000015// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:4:9 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000016// RUN: cat %t | count 1
17// RUN: grep 't1.c:8:3,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000018
Daniel Dunbar1787b702009-11-08 01:46:19 +000019// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:3:22 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000020// RUN: cat %t | count 1
21// RUN: grep 't1.c:6:17,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000022
Daniel Dunbar1787b702009-11-08 01:46:19 +000023// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:4:11 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000024// RUN: cat %t | count 1
25// RUN: grep 't1.c:6:5,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000026
Daniel Dunbar1787b702009-11-08 01:46:19 +000027// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:5:30 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000028// 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 Dunbar1787b702009-11-08 01:46:19 +000036// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:12:7 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000037// RUN: cat %t | count 1
38// RUN: grep 't1.c:21:3,' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000039
Daniel Dunbar1787b702009-11-08 01:46:19 +000040// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/t1.c:16:7 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000041// RUN: cat %t | count 1
42// RUN: grep 't1.c:22:3,' %t
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000043
Daniel Dunbar1787b702009-11-08 01:46:19 +000044// RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/foo.h:7:11 -print-refs > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000045// 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