Return True if the given function attribute is supported.
(cmd, attribute, name)
| 88 | |
| 89 | |
| 90 | def check_gcc_function_attribute(cmd, attribute, name): |
| 91 | """Return True if the given function attribute is supported.""" |
| 92 | cmd._check_compiler() |
| 93 | body = textwrap.dedent(""" |
| 94 | #pragma GCC diagnostic error "-Wattributes" |
| 95 | #pragma clang diagnostic error "-Wattributes" |
| 96 | |
| 97 | int %s %s(void* unused) |
| 98 | { |
| 99 | return 0; |
| 100 | } |
| 101 | |
| 102 | int |
| 103 | main() |
| 104 | { |
| 105 | return 0; |
| 106 | } |
| 107 | """) % (attribute, name) |
| 108 | return cmd.try_compile(body, None, None) != 0 |
| 109 | |
| 110 | |
| 111 | def check_gcc_function_attribute_with_intrinsics(cmd, attribute, name, code, |
no test coverage detected