Enhance the array bounds checking to work for several other constructs,
especially C++ code, and generally expand the test coverage.

Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125775 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/encode.m b/test/Parser/encode.m
index e0e7535..7b8022e 100644
--- a/test/Parser/encode.m
+++ b/test/Parser/encode.m
@@ -1,8 +1,8 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
 int main(void) {
-  const char ch = @encode(char *)[2];
-  char c = @encode(char *)[2] + 4;
+  const char ch = @encode(char *)[0];
+  char c = @encode(char *)[0] + 4;
   return c;
 }