blob: 7117bce4bb7477a3119ed32d2067a53e9cc9d1d5 [file] [log] [blame]
Douglas Gregor261a89b2015-06-19 17:51:05 +00001// RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify
2
Douglas Gregoraea7afd2015-06-24 22:02:08 +00003_Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}}
Douglas Gregor261a89b2015-06-19 17:51:05 +00004
5#pragma clang diagnostic push
6#pragma clang diagnostic ignored "-Wnullability-extension"
Douglas Gregoraea7afd2015-06-24 22:02:08 +00007_Nonnull int *ptr2; // no-warning
Douglas Gregor261a89b2015-06-19 17:51:05 +00008#pragma clang diagnostic pop
9
Douglas Gregor55c4ef32015-06-29 18:15:31 +000010#if !__has_feature(nullability)
11# error Nullability should always be supported
Douglas Gregor261a89b2015-06-19 17:51:05 +000012#endif
13
14#if !__has_extension(nullability)
15# error Nullability should always be supported as an extension
16#endif