summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-15 19:40:17 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-15 19:40:17 +0000
commit082c3e69eb43c76c5b79cdf684f7a83f76dd78fa (patch)
tree31a90ac1d6285a60724eb5f021a19c6e8c247686 /clang/test
parente17df0b7f006e5500a90276ea08b2dddb88e6c1b (diff)
downloadbcm5719-llvm-082c3e69eb43c76c5b79cdf684f7a83f76dd78fa.tar.gz
bcm5719-llvm-082c3e69eb43c76c5b79cdf684f7a83f76dd78fa.zip
Add -cursor-at=file:line:column command line option to c-index-test,
to directly check the results of clang_getCursor(). Also, start migrating some index-test tests over to c-index test [*] and some grep-using tests over to FileCheck. llvm-svn: 93537
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Index/resolve-loc.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/test/Index/resolve-loc.c b/clang/test/Index/resolve-loc.c
index 68504ee0d2b..1b40ec79625 100644
--- a/clang/test/Index/resolve-loc.c
+++ b/clang/test/Index/resolve-loc.c
@@ -15,23 +15,25 @@ struct S {
int field_var;
};
-
// RUN: %clang_cc1 -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: c-index-test \
+// RUN: -cursor-at=%s:3:8 -cursor-at=%s:5:15 -cursor-at=%s:5:25 \
+// RUN: -cursor-at=%s:7:17 -cursor-at=%s:7:23 -cursor-at=%s:8:10 \
+// RUN: -cursor-at=%s:9:15 -cursor-at=%s:10:9 -cursor-at=%s:15:10 \
+// RUN: %s | FileCheck %s
+// CHECK: VarDecl=top_var
+// CHECK: FunctionDecl=top_func_decl
+// CHECK: ParmDecl=param1
+// CHECK: FunctionDecl=top_func_def
+// CHECK: ParmDecl=param2
+// CHECK: VarDecl=local_var1
+// CHECK: VarDecl=for_var
+// CHECK: VarDecl=local_var2
+// CHECK: FieldDecl=field_var
+
+// FIXME: Eliminate these once clang_getCursor supports them.
// 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
OpenPOWER on IntegriCloud