2017-09-26 Thomas Koenig <tkoenig@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / inline-13.c
blob62a898c3c100da382cd9ae4910f844e985735ba0
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" } } */
15 inline int dontgenerate1 (void)
17 return 1;
20 inline int dontgenerate2 (void);
21 inline int dontgenerate2 (void)
23 return 2;
26 inline int dontgenerate3 (void)
28 return 3;
30 inline int dontgenerate3 (void);
32 extern inline int func1 (void) { return 1; }
34 extern inline int func2 (void);
35 inline int func2 (void) { return 2; }
37 inline int func3 (void) { return 3; }
38 extern inline int func3 (void);
40 inline int func4 (void);
41 extern inline int func4 (void) { return 4; }
43 extern inline int func5 (void) { return 5; }
44 inline int func5 (void);
46 extern int func6 (void);
47 inline int func6 (void) { return 6; }
49 inline int func7 (void) { return 7; }
50 extern int func7 (void);
52 inline int func8 (void);
53 extern int func8 (void) { return 8; }
55 extern int func9 (void) { return 9; }
56 inline int func9 (void);