1*67e74705SXin Li // RUN: %clang_cc1 -triple i386-unknown-unknown -fms-compatibility -std=c++11 -E %s -o - | FileCheck %s 2*67e74705SXin Li 3*67e74705SXin Li // CHECK: has_cxx11_carries_dep 4*67e74705SXin Li #if __has_cpp_attribute(carries_dependency) 5*67e74705SXin Li int has_cxx11_carries_dep(); 6*67e74705SXin Li #endif 7*67e74705SXin Li 8*67e74705SXin Li // CHECK: has_clang_fallthrough_1 9*67e74705SXin Li #if __has_cpp_attribute(clang::fallthrough) 10*67e74705SXin Li int has_clang_fallthrough_1(); 11*67e74705SXin Li #endif 12*67e74705SXin Li 13*67e74705SXin Li // CHECK: does_not_have_selectany 14*67e74705SXin Li #if !__has_cpp_attribute(selectany) 15*67e74705SXin Li int does_not_have_selectany(); 16*67e74705SXin Li #endif 17*67e74705SXin Li 18*67e74705SXin Li // The attribute name can be bracketed with double underscores. 19*67e74705SXin Li // CHECK: has_clang_fallthrough_2 20*67e74705SXin Li #if __has_cpp_attribute(clang::__fallthrough__) 21*67e74705SXin Li int has_clang_fallthrough_2(); 22*67e74705SXin Li #endif 23*67e74705SXin Li 24*67e74705SXin Li // The scope cannot be bracketed with double underscores. 25*67e74705SXin Li // CHECK: does_not_have___clang___fallthrough 26*67e74705SXin Li #if !__has_cpp_attribute(__clang__::fallthrough) 27*67e74705SXin Li int does_not_have___clang___fallthrough(); 28*67e74705SXin Li #endif 29*67e74705SXin Li 30*67e74705SXin Li // Test that C++11, target-specific attributes behave properly. 31*67e74705SXin Li 32*67e74705SXin Li // CHECK: does_not_have_mips16 33*67e74705SXin Li #if !__has_cpp_attribute(gnu::mips16) 34*67e74705SXin Li int does_not_have_mips16(); 35*67e74705SXin Li #endif 36*67e74705SXin Li 37*67e74705SXin Li // Test that the version numbers of attributes listed in SD-6 are supported 38*67e74705SXin Li // correctly. 39*67e74705SXin Li 40*67e74705SXin Li // CHECK: has_cxx11_carries_dep_vers 41*67e74705SXin Li #if __has_cpp_attribute(carries_dependency) == 200809 42*67e74705SXin Li int has_cxx11_carries_dep_vers(); 43*67e74705SXin Li #endif 44*67e74705SXin Li 45*67e74705SXin Li // CHECK: has_cxx11_noreturn_vers 46*67e74705SXin Li #if __has_cpp_attribute(noreturn) == 200809 47*67e74705SXin Li int has_cxx11_noreturn_vers(); 48*67e74705SXin Li #endif 49*67e74705SXin Li 50*67e74705SXin Li // CHECK: has_cxx14_deprecated_vers 51*67e74705SXin Li #if __has_cpp_attribute(deprecated) == 201309 52*67e74705SXin Li int has_cxx14_deprecated_vers(); 53*67e74705SXin Li #endif 54*67e74705SXin Li 55*67e74705SXin Li // CHECK: has_cxx1z_nodiscard 56*67e74705SXin Li #if __has_cpp_attribute(nodiscard) == 201603 57*67e74705SXin Li int has_cxx1z_nodiscard(); 58*67e74705SXin Li #endif 59*67e74705SXin Li 60*67e74705SXin Li // CHECK: has_cxx1z_fallthrough 61*67e74705SXin Li #if __has_cpp_attribute(fallthrough) == 201603 62*67e74705SXin Li int has_cxx1z_fallthrough(); 63*67e74705SXin Li #endif 64*67e74705SXin Li 65*67e74705SXin Li // CHECK: has_declspec_uuid 66*67e74705SXin Li #if __has_declspec_attribute(uuid) 67*67e74705SXin Li int has_declspec_uuid(); 68*67e74705SXin Li #endif 69*67e74705SXin Li 70*67e74705SXin Li // CHECK: has_declspec_uuid2 71*67e74705SXin Li #if __has_declspec_attribute(__uuid__) 72*67e74705SXin Li int has_declspec_uuid2(); 73*67e74705SXin Li #endif 74*67e74705SXin Li 75*67e74705SXin Li // CHECK: does_not_have_declspec_fallthrough 76*67e74705SXin Li #if !__has_declspec_attribute(fallthrough) 77*67e74705SXin Li int does_not_have_declspec_fallthrough(); 78*67e74705SXin Li #endif 79