CIndex: For the time being, don't return translation units if we encounter an error during parsing.
 - We need to be more careful in the rest of CIndex if we are to handle
   possibly-invalid ASTs, and don't have much experience with this yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90643 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/cindex-on-invalid.m b/test/Index/cindex-on-invalid.m
new file mode 100644
index 0000000..651c40a
--- /dev/null
+++ b/test/Index/cindex-on-invalid.m
@@ -0,0 +1,8 @@
+// RUN: not c-index-test -test-load-source local %s > %t 2> %t.err
+// RUN: FileCheck %s < %t.err
+
+// CHECK: error: expected identifier or '('
+// CHECK: Unable to load translation unit!
+
+int foo;
+int