- Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
- Make sure CHECK: lines in test case match the expected output. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83316 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 90fe3a8..9204d18 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -606,7 +606,8 @@
     
   if (clang_isReference(C.kind)) {
     if (C.stmt) {
-      if (C.kind == CXCursor_ObjCClassRef)
+      if (C.kind == CXCursor_ObjCClassRef || 
+          C.kind == CXCursor_ObjCProtocolRef)
         return static_cast<Stmt *>(C.stmt);
       else
         return getDeclFromExpr(static_cast<Stmt *>(C.stmt));