Warn pointer to signed integer cast for ilp32
[official-gcc.git] / gcc / testsuite / gcc.dg / attr-noinline.c
blob7d57c0172c5001d2b58e53dfdc8eff129cea6fcf
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -finline-functions" } */
4 extern int t();
6 static inline void __attribute__((__noinline__)) function_definition(void) {t();} /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
8 static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
10 static void function_declaration_both_before(void) {t();}
12 static void function_declaration_both_after(void);
14 static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */
16 static void function_declaration_both_after(void) {t();}
18 static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
20 static inline void function_declaration_noinline_before(void) {t();} /* { dg-warning "follows declaration with attribute noinline" "" } */
22 static inline void function_declaration_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
24 static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
26 static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */
28 static void __attribute__((__noinline__)) function_declaration_inline_before(void) {t();} /* { dg-warning "follows inline declaration" "" } */
30 static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */
32 static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
34 static void function_declaration_inline_noinline_before(void) {t();}
36 static inline void function_declaration_inline_noinline_after(void);
38 static void function_declaration_inline_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
40 static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
42 static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
44 static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
46 static void function_declaration_noinline_inline_before(void) {t();}
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 ();
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" } } */