gcc_attribute_func.c revision 1.1
1/*	$NetBSD: gcc_attribute_func.c,v 1.1 2021/07/06 17:33:07 rillig Exp $	*/
2# 3 "gcc_attribute_func.c"
3
4/*
5 * Tests for the GCC __attribute__ for functions.
6 *
7 * https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
8 */
9
10void deprecated_function(void)
11    __attribute__((__noreturn__))
12    __attribute__((__aligned__(8), __cold__))
13    __attribute__((__deprecated__("do not use while driving")));
14
15__attribute__((__cold__))
16void attribute_as_prefix(void);
17
18void __attribute__((__cold__)) attribute_after_type_spec(void);
19void *__attribute__((__cold__)) attribute_before_name(void);
20/*TODO: do not allow __attribute__ after function name */
21void *attribute_after_name __attribute__((__cold__))(void);
22void *attribute_after_parameters(void) __attribute__((__cold__));
23
24/* just to trigger _some_ error, to keep the .exp file */
25/* expect+1: error: syntax error 'syntax_error' [249] */
26__attribute__((syntax_error));
27