101 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST12// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST23// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST34// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -Wreserved-attribute-identifier -fsyntax-only -verify %s -DTEST45 6#ifdef TEST17 8#define assume9#undef assume10 11#define noreturn // expected-warning {{noreturn is a reserved attribute identifier}}12#undef noreturn // expected-warning {{noreturn is a reserved attribute identifier}}13 14#define carries_dependency // expected-warning {{carries_dependency is a reserved attribute identifier}}15#undef carries_dependency // expected-warning {{carries_dependency is a reserved attribute identifier}}16 17#define deprecated // expected-warning {{deprecated is a reserved attribute identifier}}18#undef deprecated // expected-warning {{deprecated is a reserved attribute identifier}}19 20#define fallthrough // expected-warning {{fallthrough is a reserved attribute identifier}}21#undef fallthrough // expected-warning {{fallthrough is a reserved attribute identifier}}22 23#define likely // expected-warning {{likely is a reserved attribute identifier}}24#undef likely // expected-warning {{likely is a reserved attribute identifier}}25 26#define no_unique_address // expected-warning {{no_unique_address is a reserved attribute identifier}}27#undef no_unique_address // expected-warning {{no_unique_address is a reserved attribute identifier}}28 29#define unlikely // expected-warning {{unlikely is a reserved attribute identifier}}30#undef unlikely // expected-warning {{unlikely is a reserved attribute identifier}}31 32#define maybe_unused // expected-warning {{maybe_unused is a reserved attribute identifier}}33#undef maybe_unused // expected-warning {{maybe_unused is a reserved attribute identifier}}34 35#define nodiscard // expected-warning {{nodiscard is a reserved attribute identifier}}36#undef nodiscard // expected-warning {{nodiscard is a reserved attribute identifier}}37 38#elif TEST239 40#define assume "test"41#undef assume42 43#define noreturn "test" // expected-warning {{noreturn is a reserved attribute identifier}}44#undef noreturn // expected-warning {{noreturn is a reserved attribute identifier}}45 46#define carries_dependency "test" // expected-warning {{carries_dependency is a reserved attribute identifier}}47#undef carries_dependency // expected-warning {{carries_dependency is a reserved attribute identifier}}48 49#define deprecated "test" // expected-warning {{deprecated is a reserved attribute identifier}}50#undef deprecated // expected-warning {{deprecated is a reserved attribute identifier}}51 52#define fallthrough "test" // expected-warning {{fallthrough is a reserved attribute identifier}}53#undef fallthrough // expected-warning {{fallthrough is a reserved attribute identifier}}54 55#define likely "test" // expected-warning {{likely is a reserved attribute identifier}}56#undef likely // expected-warning {{likely is a reserved attribute identifier}}57 58#define no_unique_address "test" // expected-warning {{no_unique_address is a reserved attribute identifier}}59#undef no_unique_address // expected-warning {{no_unique_address is a reserved attribute identifier}}60 61#define unlikely "test" // expected-warning {{unlikely is a reserved attribute identifier}}62#undef unlikely // expected-warning {{unlikely is a reserved attribute identifier}}63 64#define maybe_unused "test" // expected-warning {{maybe_unused is a reserved attribute identifier}}65#undef maybe_unused // expected-warning {{maybe_unused is a reserved attribute identifier}}66 67#define nodiscard "test" // expected-warning {{nodiscard is a reserved attribute identifier}}68#undef nodiscard // expected-warning {{nodiscard is a reserved attribute identifier}}69 70#elif TEST371 72#define assume() "test" // expected-warning {{assume is a reserved attribute identifier}}73#define deprecated() "test" // expected-warning {{deprecated is a reserved attribute identifier}}74#define nodiscard() "test" // expected-warning {{nodiscard is a reserved attribute identifier}}75#define noreturn() "test"76#define carries_dependency() "test"77#define fallthrough() "test"78#define likely() "test"79#define no_unique_address() "test"80#define unlikely() "test"81#define maybe_unused() "test"82 83#elif TEST484 85#define assume() // expected-warning {{assume is a reserved attribute identifier}}86#define deprecated() // expected-warning {{deprecated is a reserved attribute identifier}}87#define nodiscard() // expected-warning {{nodiscard is a reserved attribute identifier}}88#define noreturn()89#define carries_dependency()90#define fallthrough()91#define likely()92#define no_unique_address()93#define unlikely()94#define maybe_unused()95 96#else97 98#error Unknown test99 100#endif101