[libclang] When doing the cursor visitation make sure declarations
in the same line do not override getting a cursor for the previous declaration.

e.g:

int x, y;
@synthesize prop1, prop2;

pointing at 'x'/'prop1' would give 'y'/'prop2' because their source ranges overlap.

rdar://11361113

llvm-svn: 158258
diff --git a/clang/test/Index/get-cursor.c b/clang/test/Index/get-cursor.c
index 23a4b5c..c0614af 100644
--- a/clang/test/Index/get-cursor.c
+++ b/clang/test/Index/get-cursor.c
@@ -4,11 +4,17 @@
 
 struct _MyS ww;
 
+int x, y;
+
 // RUN: c-index-test -cursor-at=%s:1:9 \
 // RUN:              -cursor-at=%s:2:9 \
 // RUN:              -cursor-at=%s:5:9 \
+// RUN:              -cursor-at=%s:7:5 \
+// RUN:              -cursor-at=%s:7:8 \
 // RUN:       %s | FileCheck %s
 
 // CHECK: StructDecl=_MyS:1:8 (Definition)
 // CHECK: FieldDecl=foo:2:7 (Definition)
 // CHECK: TypeRef=struct _MyS:1:8
+// CHECK: VarDecl=x:7:5
+// CHECK: VarDecl=y:7:8