Add test case for nonnull attribute.
Fix indexing bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53882 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/nonnull.c b/test/Sema/nonnull.c
new file mode 100644
index 0000000..f8a2a0e
--- /dev/null
+++ b/test/Sema/nonnull.c
@@ -0,0 +1,8 @@
+// RUN: clang -fsyntax-only -verify %s
+
+int f1(int x) __attribute__((nonnull));
+int f2(int *x) __attribute__ ((nonnull (1)));
+int f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attribute parameter 1 is out of bounds}}
+int f4(int *x, int *y) __attribute__ ((nonnull (1,2)));
+int f5(int *x, int *y) __attribute__ ((nonnull (2,1)));
+