blob: fc969e997b2d85f04f18bad8e98ab6e5642e9ae4 [file] [log] [blame]
Argyrios Kyrtzidis58f6eaf2009-07-14 05:34:59 +00001int top_var;
2
3void top_func_decl(int param1);
4
5void top_func_def(int param2) {
6 int local_var1;
7 for (int for_var = 100; for_var < 500; ++for_var) {
8 int local_var2 = for_var + 1;
9 }
10}
11
12struct S {
13 int field_var;
14};
15
16
17// RUN: clang-cc -emit-pch %s -o %t.ast &&
18// RUN: index-test %t.ast -point-at %s:1:8 | grep top_var &&
19// RUN: index-test %t.ast -point-at %s:3:15 | grep top_func_decl &&
20// RUN: index-test %t.ast -point-at %s:3:25 | grep param1 &&
21// RUN: index-test %t.ast -point-at %s:5:17 | grep top_func_def &&
22// RUN: index-test %t.ast -point-at %s:5:23 | grep param2 &&
23// RUN: index-test %t.ast -point-at %s:6:10 | grep local_var1 &&
24// RUN: index-test %t.ast -point-at %s:7:15 | grep for_var &&
25// RUN: index-test %t.ast -point-at %s:7:43 | grep top_func_def &&
26// RUN: index-test %t.ast -point-at %s:7:43 | grep '++for_var' &&
27// RUN: index-test %t.ast -point-at %s:8:9 | grep local_var2 &&
28// RUN: index-test %t.ast -point-at %s:8:30 | grep local_var2 &&
29// RUN: index-test %t.ast -point-at %s:8:30 | grep 'for_var + 1' &&
Argyrios Kyrtzidis12585542009-07-14 03:18:40 +000030
31// fields test.
Argyrios Kyrtzidis58f6eaf2009-07-14 05:34:59 +000032// RUN: index-test %t.ast -point-at %s:13:10 | grep field_var