Argyrios Kyrtzidis | 58f6eaf | 2009-07-14 05:34:59 +0000 | [diff] [blame^] | 1 | int top_var; |
| 2 | |
| 3 | void top_func_decl(int param1); |
| 4 | |
| 5 | void 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 | |
| 12 | struct 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 Kyrtzidis | 1258554 | 2009-07-14 03:18:40 +0000 | [diff] [blame] | 30 | |
| 31 | // fields test. |
Argyrios Kyrtzidis | 58f6eaf | 2009-07-14 05:34:59 +0000 | [diff] [blame^] | 32 | // RUN: index-test %t.ast -point-at %s:13:10 | grep field_var |