Douglas Gregor | 261a89b | 2015-06-19 17:51:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify |
| 2 | |
Douglas Gregor | aea7afd | 2015-06-24 22:02:08 +0000 | [diff] [blame] | 3 | _Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}} |
Douglas Gregor | 261a89b | 2015-06-19 17:51:05 +0000 | [diff] [blame] | 4 | |
| 5 | #pragma clang diagnostic push |
| 6 | #pragma clang diagnostic ignored "-Wnullability-extension" |
Douglas Gregor | aea7afd | 2015-06-24 22:02:08 +0000 | [diff] [blame] | 7 | _Nonnull int *ptr2; // no-warning |
Douglas Gregor | 261a89b | 2015-06-19 17:51:05 +0000 | [diff] [blame] | 8 | #pragma clang diagnostic pop |
| 9 | |
Douglas Gregor | 55c4ef3 | 2015-06-29 18:15:31 +0000 | [diff] [blame] | 10 | #if !__has_feature(nullability) |
| 11 | # error Nullability should always be supported |
Douglas Gregor | 261a89b | 2015-06-19 17:51:05 +0000 | [diff] [blame] | 12 | #endif |
| 13 | |
Jordan Rose | 303e2f1 | 2016-11-10 23:28:17 +0000 | [diff] [blame] | 14 | #if !__has_feature(nullability_on_arrays) |
| 15 | # error Nullability on array parameters should always be supported |
| 16 | #endif |
| 17 | |
Douglas Gregor | 261a89b | 2015-06-19 17:51:05 +0000 | [diff] [blame] | 18 | #if !__has_extension(nullability) |
| 19 | # error Nullability should always be supported as an extension |
| 20 | #endif |
Jordan Rose | 303e2f1 | 2016-11-10 23:28:17 +0000 | [diff] [blame] | 21 | |
| 22 | #if !__has_extension(nullability_on_arrays) |
| 23 | # error Nullability on array parameters should always be supported as an extension |
| 24 | #endif |