1 /* Verify basic C99 inline functionality. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c99" } */
4 /* { dg-final { scan-assembler-not "dontgenerate" } } */
5 /* { dg-final { scan-assembler "func1" } } */
6 /* { dg-final { scan-assembler "func2" } } */
7 /* { dg-final { scan-assembler "func3" } } */
8 /* { dg-final { scan-assembler "func4" } } */
9 /* { dg-final { scan-assembler "func5" } } */
10 /* { dg-final { scan-assembler "func6" } } */
11 /* { dg-final { scan-assembler "func7" } } */
12 /* { dg-final { scan-assembler "func8" } } */
13 /* { dg-final { scan-assembler "func9" } } */
14
dontgenerate1(void)15 inline int dontgenerate1 (void)
16 {
17 return 1;
18 }
19
20 inline int dontgenerate2 (void);
dontgenerate2(void)21 inline int dontgenerate2 (void)
22 {
23 return 2;
24 }
25
dontgenerate3(void)26 inline int dontgenerate3 (void)
27 {
28 return 3;
29 }
30 inline int dontgenerate3 (void);
31
func1(void)32 extern inline int func1 (void) { return 1; }
33
34 extern inline int func2 (void);
func2(void)35 inline int func2 (void) { return 2; }
36
func3(void)37 inline int func3 (void) { return 3; }
38 extern inline int func3 (void);
39
40 inline int func4 (void);
func4(void)41 extern inline int func4 (void) { return 4; }
42
func5(void)43 extern inline int func5 (void) { return 5; }
44 inline int func5 (void);
45
46 extern int func6 (void);
func6(void)47 inline int func6 (void) { return 6; }
48
func7(void)49 inline int func7 (void) { return 7; }
50 extern int func7 (void);
51
52 inline int func8 (void);
func8(void)53 extern int func8 (void) { return 8; }
54
func9(void)55 extern int func9 (void) { return 9; }
56 inline int func9 (void);
57