blob: d04b79b024eddbe156088523c7bafb394bafd98d [file] [log] [blame]
Argyrios Kyrtzidis30b983b2009-06-25 18:22:52 +00001// RUN: clang-cc -emit-pch %s -o %t.ast &&
2// RUN: index-test %t.ast -point-at %s:15:8 | grep top_var &&
3// RUN: index-test %t.ast -point-at %s:17:15 | grep top_func_decl &&
4// RUN: index-test %t.ast -point-at %s:17:25 | grep param1 &&
5// RUN: index-test %t.ast -point-at %s:19:17 | grep top_func_def &&
6// RUN: index-test %t.ast -point-at %s:19:23 | grep param2 &&
7// RUN: index-test %t.ast -point-at %s:20:10 | grep local_var1 &&
8// RUN: index-test %t.ast -point-at %s:21:15 | grep for_var &&
9// RUN: index-test %t.ast -point-at %s:21:43 | grep top_func_def &&
10// RUN: index-test %t.ast -point-at %s:21:43 | grep '++for_var' &&
11// RUN: index-test %t.ast -point-at %s:22:9 | grep local_var2 &&
12// RUN: index-test %t.ast -point-at %s:22:30 | grep local_var2 &&
13// RUN: index-test %t.ast -point-at %s:22:30 | grep 'for_var + 1'
14
15int top_var;
16
17void top_func_decl(int param1);
18
19void top_func_def(int param2) {
20 int local_var1;
21 for (int for_var = 100; for_var < 500; ++for_var) {
22 int local_var2 = for_var + 1;
23 }
24}