brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 6f6f519 Raw
91 lines · c
1// RUN: %clang_cc1 -triple arm-unknown-linux -verify -E %s -o - | FileCheck %s2 3// CHECK: always_inline4#if __has_attribute(always_inline)5int always_inline();6#endif7 8// CHECK: __always_inline__9#if __has_attribute(__always_inline__)10int __always_inline__();11#endif12 13// CHECK: warn_unused_result14#if __has_attribute(warn_unused_result)15int warn_unused_result();16#endif17 18// CHECK: no_dummy_attribute19#if !__has_attribute(dummy_attribute)20int no_dummy_attribute();21#endif22 23// CHECK: has_has_attribute24#ifdef __has_attribute25int has_has_attribute();26#endif27 28// CHECK: has_something_we_dont_have29#if !__has_attribute(something_we_dont_have)30int has_something_we_dont_have();31#endif32 33#if __has_attribute(__const)34 int fn3() __attribute__ ((__const));35#endif36 37#if __has_attribute(const)38 static int constFunction() __attribute__((const));39#endif40 41// CHECK: has_no_volatile_attribute42#if !__has_attribute(volatile)43int has_no_volatile_attribute();44#endif45 46// CHECK: has_arm_interrupt47#if __has_attribute(interrupt)48  int has_arm_interrupt();49#endif50 51// CHECK: does_not_have_dllexport52#if !__has_attribute(dllexport)53  int does_not_have_dllexport();54#endif55 56// CHECK: does_not_have_uuid57#if !__has_attribute(uuid)58  int does_not_have_uuid59#endif60 61#if __has_cpp_attribute(selectany) // expected-error {{function-like macro '__has_cpp_attribute' is not defined}}62#endif63 64// Test that macro expansion of the builtin argument works.65#define F fallthrough66 67#if __has_attribute(F)68int has_fallthrough;69#endif70// CHECK: int has_fallthrough;71 72#if __has_attribute(F\73)74int has_fallthrough_2;75#endif76// CHECK: int has_fallthrough_2;77 78#define F_2 fall\79through80 81#if __has_attribute(F_2)82int has_fallthrough_3;83#endif84// CHECK: int has_fallthrough_3;85 86#if __has_attribute(F_2\87)88int has_fallthrough_4;89#endif90// CHECK: int has_fallthrough_4;91