diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/Preprocessor/has_attribute.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'test/Preprocessor/has_attribute.cpp')
-rw-r--r-- | test/Preprocessor/has_attribute.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/Preprocessor/has_attribute.cpp b/test/Preprocessor/has_attribute.cpp new file mode 100644 index 0000000..1ab4502 --- /dev/null +++ b/test/Preprocessor/has_attribute.cpp @@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -triple i386-unknown-unknown -fms-compatibility -std=c++11 -E %s -o - | FileCheck %s + +// CHECK: has_cxx11_carries_dep +#if __has_cpp_attribute(carries_dependency) + int has_cxx11_carries_dep(); +#endif + +// CHECK: has_clang_fallthrough_1 +#if __has_cpp_attribute(clang::fallthrough) + int has_clang_fallthrough_1(); +#endif + +// CHECK: does_not_have_selectany +#if !__has_cpp_attribute(selectany) + int does_not_have_selectany(); +#endif + +// 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. +// 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_not_have_mips16 +#if !__has_cpp_attribute(gnu::mips16) + int does_not_have_mips16(); +#endif + +// Test that the version numbers of attributes listed in SD-6 are supported +// correctly. + +// CHECK: has_cxx11_carries_dep_vers +#if __has_cpp_attribute(carries_dependency) == 200809 + int has_cxx11_carries_dep_vers(); +#endif + +// CHECK: has_cxx11_noreturn_vers +#if __has_cpp_attribute(noreturn) == 200809 + int has_cxx11_noreturn_vers(); +#endif + +// CHECK: has_cxx14_deprecated_vers +#if __has_cpp_attribute(deprecated) == 201309 + int has_cxx14_deprecated_vers(); +#endif + +// CHECK: has_declspec_uuid +#if __has_declspec_attribute(uuid) + int has_declspec_uuid(); +#endif + +// CHECK: has_declspec_uuid2 +#if __has_declspec_attribute(__uuid__) + int has_declspec_uuid2(); +#endif + +// CHECK: does_not_have_declspec_fallthrough +#if !__has_declspec_attribute(fallthrough) + int does_not_have_declspec_fallthrough(); +#endif |