blob: f4697171ee185f4cb0f617fa55c4ca185594f935 [file] [log] [blame]
Argyrios Kyrtzidis5d51ae22009-07-15 18:59:40 +00001// Run lines are sensitive to line numbers and come below the code.
2
Argyrios Kyrtzidis58f6eaf2009-07-14 05:34:59 +00003int top_var;
4
5void top_func_decl(int param1);
6
7void top_func_def(int param2) {
8 int local_var1;
9 for (int for_var = 100; for_var < 500; ++for_var) {
10 int local_var2 = for_var + 1;
11 }
12}
13
14struct S {
15 int field_var;
16};
17
18
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000019// RUN: clang-cc -emit-pch %s -o %t.ast
20// RUN: index-test %t.ast -point-at %s:3:8 | grep top_var
21// RUN: index-test %t.ast -point-at %s:5:15 | grep top_func_decl
22// RUN: index-test %t.ast -point-at %s:5:25 | grep param1
23// RUN: index-test %t.ast -point-at %s:7:17 | grep top_func_def
24// RUN: index-test %t.ast -point-at %s:7:23 | grep param2
25// RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1
26// RUN: index-test %t.ast -point-at %s:9:15 | grep for_var
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000027
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000028// RUN: index-test %t.ast -point-at %s:9:43 > %t
29// RUN: grep '++for_var' %t
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000030
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000031// RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2
Argyrios Kyrtzidis3e8efd92009-07-21 00:06:46 +000032
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000033// RUN: index-test %t.ast -point-at %s:10:30 > %t
34// RUN: grep 'for_var + 1' %t
Argyrios Kyrtzidis12585542009-07-14 03:18:40 +000035
36// fields test.
Argyrios Kyrtzidis5d51ae22009-07-15 18:59:40 +000037// RUN: index-test %t.ast -point-at %s:15:10 | grep field_var