summaryrefslogtreecommitdiff
path: root/test/Index/resolve-loc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Index/resolve-loc.c')
-rw-r--r--test/Index/resolve-loc.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/test/Index/resolve-loc.c b/test/Index/resolve-loc.c
index d04b79b024edd..cae86f38dd6d4 100644
--- a/test/Index/resolve-loc.c
+++ b/test/Index/resolve-loc.c
@@ -1,16 +1,4 @@
-// RUN: clang-cc -emit-pch %s -o %t.ast &&
-// RUN: index-test %t.ast -point-at %s:15:8 | grep top_var &&
-// RUN: index-test %t.ast -point-at %s:17:15 | grep top_func_decl &&
-// RUN: index-test %t.ast -point-at %s:17:25 | grep param1 &&
-// RUN: index-test %t.ast -point-at %s:19:17 | grep top_func_def &&
-// RUN: index-test %t.ast -point-at %s:19:23 | grep param2 &&
-// RUN: index-test %t.ast -point-at %s:20:10 | grep local_var1 &&
-// RUN: index-test %t.ast -point-at %s:21:15 | grep for_var &&
-// RUN: index-test %t.ast -point-at %s:21:43 | grep top_func_def &&
-// RUN: index-test %t.ast -point-at %s:21:43 | grep '++for_var' &&
-// RUN: index-test %t.ast -point-at %s:22:9 | grep local_var2 &&
-// RUN: index-test %t.ast -point-at %s:22:30 | grep local_var2 &&
-// RUN: index-test %t.ast -point-at %s:22:30 | grep 'for_var + 1'
+// Run lines are sensitive to line numbers and come below the code.
int top_var;
@@ -22,3 +10,28 @@ void top_func_def(int param2) {
int local_var2 = for_var + 1;
}
}
+
+struct S {
+ int field_var;
+};
+
+
+// RUN: clang-cc -emit-pch %s -o %t.ast &&
+// RUN: index-test %t.ast -point-at %s:3:8 | grep top_var &&
+// RUN: index-test %t.ast -point-at %s:5:15 | grep top_func_decl &&
+// RUN: index-test %t.ast -point-at %s:5:25 | grep param1 &&
+// RUN: index-test %t.ast -point-at %s:7:17 | grep top_func_def &&
+// RUN: index-test %t.ast -point-at %s:7:23 | grep param2 &&
+// RUN: index-test %t.ast -point-at %s:8:10 | grep local_var1 &&
+// RUN: index-test %t.ast -point-at %s:9:15 | grep for_var &&
+
+// RUN: index-test %t.ast -point-at %s:9:43 > %t &&
+// RUN: grep '++for_var' %t &&
+
+// RUN: index-test %t.ast -point-at %s:10:9 | grep local_var2 &&
+
+// RUN: index-test %t.ast -point-at %s:10:30 > %t &&
+// RUN: grep 'for_var + 1' %t &&
+
+// fields test.
+// RUN: index-test %t.ast -point-at %s:15:10 | grep field_var