Ted Kremenek | 465172f | 2008-07-21 22:09:15 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
Ted Kremenek | 7fb43c1 | 2008-09-01 19:57:52 +0000 | [diff] [blame] | 3 | int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}} |
Ted Kremenek | 465172f | 2008-07-21 22:09:15 +0000 | [diff] [blame] | 4 | int f2(int *x) __attribute__ ((nonnull (1))); |
| 5 | int f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attribute parameter 1 is out of bounds}} |
| 6 | int f4(int *x, int *y) __attribute__ ((nonnull (1,2))); |
| 7 | int f5(int *x, int *y) __attribute__ ((nonnull (2,1))); |
| 8 | |