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