blob: 3d9b329abe65f08ed70eac5a91da7f0b064596b8 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Ted Kremenek465172f2008-07-21 22:09:15 +00002
Ted Kremenek7fb43c12008-09-01 19:57:52 +00003int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}}
Ted Kremenek465172f2008-07-21 22:09:15 +00004int f2(int *x) __attribute__ ((nonnull (1)));
5int f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attribute parameter 1 is out of bounds}}
6int f4(int *x, int *y) __attribute__ ((nonnull (1,2)));
7int f5(int *x, int *y) __attribute__ ((nonnull (2,1)));
8