diff options
Diffstat (limited to 'test/Preprocessor/has_attribute.cpp')
-rw-r--r-- | test/Preprocessor/has_attribute.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/Preprocessor/has_attribute.cpp b/test/Preprocessor/has_attribute.cpp index 2cfa005fb09fa..91f3501666fc7 100644 --- a/test/Preprocessor/has_attribute.cpp +++ b/test/Preprocessor/has_attribute.cpp @@ -21,14 +21,34 @@ int has_clang_fallthrough_2(); #endif -// The scope cannot be bracketed with double underscores. +// The scope cannot be bracketed with double underscores unless it is +// for gnu or clang. +// CHECK: does_not_have___gsl___suppress +#if !__has_cpp_attribute(__gsl__::suppress) + int does_not_have___gsl___suppress(); +#endif + +// We do somewhat support the __clang__ vendor namespace, but it is a +// predefined macro and thus we encourage users to use _Clang instead. +// Because of this, we do not support __has_cpp_attribute for that +// vendor namespace. // CHECK: does_not_have___clang___fallthrough #if !__has_cpp_attribute(__clang__::fallthrough) int does_not_have___clang___fallthrough(); #endif -// Test that C++11, target-specific attributes behave properly. +// CHECK: does_have_Clang_fallthrough +#if __has_cpp_attribute(_Clang::fallthrough) + int does_have_Clang_fallthrough(); +#endif +// CHECK: has_gnu_const +#if __has_cpp_attribute(__gnu__::__const__) + int has_gnu_const(); +#endif
+
+// Test that C++11, target-specific attributes behave properly.
+
// CHECK: does_not_have_mips16 #if !__has_cpp_attribute(gnu::mips16) int does_not_have_mips16(); |