]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Index/find-refs.c
Update clang to r89337.
[FreeBSD/FreeBSD.git] / test / Index / find-refs.c
1 // 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
3
4 // RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/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
10
11 // RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/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/Inputs/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/Inputs/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/Inputs/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/Inputs/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
32
33 // field test
34
35 // FIXME: References point at the start of MemberExpr, make them point at the field instead.
36 // RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/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/Inputs/t1.c:16:7 -print-refs > %t
41 // RUN: cat %t | count 1
42 // RUN: grep 't1.c:22:3,' %t
43
44 // RUN: index-test %t1.ast %t2.ast -point-at %S/Inputs/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