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
6 # define HAS_ATTR(a) __has_cpp_attribute (a)
8 # define HAS_ATTR(a) __has_c_attribute (a)
11 #if __has_attribute(example)
12 // CHECK: has_attribute(example) was true
13 has_attribute(example
) was
true
16 // CHECK: has_$LANG_attribute(example) was true
17 has_$
LANG_attribute(example
) was
true
20 #if __has_attribute(doesnt_exist)
21 // CHECK-NOT: has_attribute(doesnt_exist) unexpectedly was true
22 has_attribute(doesnt_exist
) unexpectedly was
true
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