1 /* $NetBSD: gcc_attribute.c,v 1.1 2021/04/30 23:49:36 rillig Exp $ */ 2 # 3 "gcc_attribute.c" 3 4 /* 5 * Tests for the various attributes for functions, types, statements that are 6 * provided by GCC. 7 * 8 * https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html 9 * https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html 10 * https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html 11 * https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html 12 * https://gcc.gnu.org/onlinedocs/gcc/Enumerator-Attributes.html 13 * https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html 14 * https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html 15 */ 16 17 void __attribute__((noinline)) 18 do_not_inline(void) 19 { 20 } 21 22 /* expect+1: syntax error 'nonnull' */ 23 void __attribute__((nonnull(1, 2))) 24 my_memcpy(void *dest, const void *src, unsigned long len); 25 26 /* expect+1: syntax error 'unknown_attribute' */ 27 void __attribute__((unknown_attribute)) 28 function_with_unknown_attribute(void); 29