From 5224e6a81d110faeba866ab2fef8458b6bcac111 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 21 Jul 2008 22:09:15 +0000 Subject: Add test case for nonnull attribute. Fix indexing bug. llvm-svn: 53882 --- clang/test/Sema/nonnull.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clang/test/Sema/nonnull.c (limited to 'clang/test/Sema/nonnull.c') diff --git a/clang/test/Sema/nonnull.c b/clang/test/Sema/nonnull.c new file mode 100644 index 00000000000..f8a2a0ed788 --- /dev/null +++ b/clang/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))); + -- cgit v1.2.3