diff options
Diffstat (limited to 'clang/test/Preprocessor/has_attribute.cpp')
-rw-r--r-- | clang/test/Preprocessor/has_attribute.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/clang/test/Preprocessor/has_attribute.cpp b/clang/test/Preprocessor/has_attribute.cpp index 53d1fb07b9e..91f3501666f 100644 --- a/clang/test/Preprocessor/has_attribute.cpp +++ b/clang/test/Preprocessor/has_attribute.cpp @@ -18,17 +18,33 @@ // The attribute name can be bracketed with double underscores. // CHECK: has_clang_fallthrough_2 #if __has_cpp_attribute(clang::__fallthrough__) - int has_clang_fallthrough_2();
-#endif
-
-// The scope cannot be bracketed with double underscores unless it is for gnu.
-// CHECK: does_not_have___clang___fallthrough
-#if !__has_cpp_attribute(__clang__::fallthrough)
- int does_not_have___clang___fallthrough();
-#endif
-// CHECK: has_gnu_const
-#if __has_cpp_attribute(__gnu__::__const__)
- int has_gnu_const();
+ int has_clang_fallthrough_2(); +#endif + +// 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 + +// 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.
|