[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Frontend / plugin-attribute-pp.cpp
blob94ba14e272eefeef38defc83cf7adde2de7c90e6
1 // RUN: %clang -fplugin=%llvmshlibdir/Attribute%pluginext -E %s | FileCheck %s
2 // RUN: %clang -fplugin=%llvmshlibdir/Attribute%pluginext -E %s -x c | FileCheck %s
3 // REQUIRES: plugins, examples
5 #ifdef __cplusplus
6 # define HAS_ATTR(a) __has_cpp_attribute (a)
7 #else
8 # define HAS_ATTR(a) __has_c_attribute (a)
9 #endif
11 #if __has_attribute(example)
12 // CHECK: has_attribute(example) was true
13 has_attribute(example) was true
14 #endif
15 #if HAS_ATTR(example)
16 // CHECK: has_$LANG_attribute(example) was true
17 has_$LANG_attribute(example) was true
18 #endif
20 #if __has_attribute(doesnt_exist)
21 // CHECK-NOT: has_attribute(doesnt_exist) unexpectedly was true
22 has_attribute(doesnt_exist) unexpectedly was true
23 #endif
25 #if HAS_ATTR(doesnt_exist)
26 // CHECK-NOT: has_$LANG_attribute(doesnt_exist) unexpectedly was true
27 has_$LANG_attribute(doesnt_exist) unexpectedly was true
28 #endif