1 |
149 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-O2 -finline-functions" } */
|
3 |
|
|
|
4 |
|
|
static inline void __attribute__((__noinline__)) function_definition(void) {} /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
|
5 |
|
|
|
6 |
|
|
static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
|
7 |
|
|
|
8 |
|
|
static void function_declaration_both_before(void) {}
|
9 |
|
|
|
10 |
|
|
static void function_declaration_both_after(void);
|
11 |
|
|
|
12 |
|
|
static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */
|
13 |
|
|
|
14 |
|
|
static void function_declaration_both_after(void) {}
|
15 |
|
|
|
16 |
|
|
static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */
|
17 |
|
|
|
18 |
|
|
static inline void function_declaration_noinline_before(void) {} /* { dg-warning "follows declaration with attribute noinline" "" } */
|
19 |
|
|
|
20 |
|
|
static inline void function_declaration_noinline_after(void) {} /* { dg-warning "previous definition" "" } */
|
21 |
|
|
|
22 |
|
|
static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
|
23 |
|
|
|
24 |
|
|
static inline void function_declaration_inline_before(void); /* { dg-warning "previous declaration" "" } */
|
25 |
|
|
|
26 |
|
|
static void __attribute__((__noinline__)) function_declaration_inline_before(void) {} /* { dg-warning "follows inline declaration" "" } */
|
27 |
|
|
|
28 |
|
|
static inline void function_declaration_inline_noinline_before(void); /* { dg-warning "previous declaration" "" } */
|
29 |
|
|
|
30 |
|
|
static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
|
31 |
|
|
|
32 |
|
|
static void function_declaration_inline_noinline_before(void) {}
|
33 |
|
|
|
34 |
|
|
static inline void function_declaration_inline_noinline_after(void);
|
35 |
|
|
|
36 |
|
|
static void function_declaration_inline_noinline_after(void) {} /* { dg-warning "previous definition" "" } */
|
37 |
|
|
|
38 |
|
|
static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
|
39 |
|
|
|
40 |
|
|
static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-warning "previous declaration" "" } */
|
41 |
|
|
|
42 |
|
|
static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
|
43 |
|
|
|
44 |
|
|
static void function_declaration_noinline_inline_before(void) {}
|
45 |
|
|
|
46 |
|
|
void f () {
|
47 |
|
|
function_definition ();
|
48 |
|
|
function_declaration_both_before ();
|
49 |
|
|
function_declaration_both_after ();
|
50 |
|
|
function_declaration_noinline_before ();
|
51 |
|
|
function_declaration_noinline_after ();
|
52 |
|
|
function_declaration_inline_before ();
|
53 |
|
|
function_declaration_inline_noinline_before ();
|
54 |
|
|
function_declaration_inline_noinline_after ();
|
55 |
|
|
function_declaration_noinline_inline_before ();
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
/* { dg-final { scan-assembler "function_definition" } } */
|
59 |
|
|
/* { dg-final { scan-assembler "function_declaration_both_before" } } */
|
60 |
|
|
/* { dg-final { scan-assembler "function_declaration_both_after" } } */
|
61 |
|
|
/* { dg-final { scan-assembler "function_declaration_noinline_before" } } */
|
62 |
|
|
/* { dg-final { scan-assembler "function_declaration_noinline_after" } } */
|
63 |
|
|
/* { dg-final { scan-assembler "function_declaration_inline_before" } } */
|
64 |
|
|
/* { dg-final { scan-assembler "function_declaration_inline_noinline_before" } } */
|
65 |
|
|
/* { dg-final { scan-assembler "function_declaration_inline_noinline_after" } } */
|
66 |
|
|
/* { dg-final { scan-assembler "function_declaration_noinline_inline_before" } } */
|