From 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 19 Jan 2019 10:04:05 +0000 Subject: Vendor import of clang trunk r351319 (just before the release_80 branch point): https://llvm.org/svn/llvm-project/cfe/trunk@351319 --- test/Preprocessor/has_attribute.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'test/Preprocessor/has_attribute.cpp') diff --git a/test/Preprocessor/has_attribute.cpp b/test/Preprocessor/has_attribute.cpp index 2cfa005fb09f..91f3501666fc 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(); -- cgit v1.3