2008-07-22 06:09:15 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify %s
|
|
|
|
|
2008-09-02 03:57:52 +08:00
|
|
|
int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}}
|
2008-07-22 06:09:15 +08:00
|
|
|
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)));
|
|
|
|
|