brintos

brintos / llvm-project-archived public Read only

0
0
Text · 858 B · 94ba14e Raw
29 lines · cpp
1// RUN: %clang -fplugin=%llvmshlibdir/Attribute%pluginext -E %s | FileCheck %s2// RUN: %clang -fplugin=%llvmshlibdir/Attribute%pluginext -E %s -x c | FileCheck %s3// REQUIRES: plugins, examples4 5#ifdef __cplusplus6# define HAS_ATTR(a) __has_cpp_attribute (a)7#else8# define HAS_ATTR(a) __has_c_attribute (a)9#endif10 11#if __has_attribute(example)12// CHECK: has_attribute(example) was true13has_attribute(example) was true14#endif15#if HAS_ATTR(example)16// CHECK: has_$LANG_attribute(example) was true17has_$LANG_attribute(example) was true18#endif19 20#if __has_attribute(doesnt_exist)21// CHECK-NOT: has_attribute(doesnt_exist) unexpectedly was true22has_attribute(doesnt_exist) unexpectedly was true23#endif24 25#if HAS_ATTR(doesnt_exist)26// CHECK-NOT: has_$LANG_attribute(doesnt_exist) unexpectedly was true27has_$LANG_attribute(doesnt_exist) unexpectedly was true28#endif29