1 /* Test -fno-gnu89-extern-inline. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c99 -fno-gnu89-inline" } */
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
15 #ifdef __GNUC_GNU_INLINE__
16 #error __GNUC_GNU_INLINE__ is defined
17 #endif
18
19 #ifndef __GNUC_STDC_INLINE__
20 #error __GNUC_STDC_INLINE__ is not defined
21 #endif
22
dontgenerate1(void)23 inline int dontgenerate1 (void)
24 {
25 return 1;
26 }
27
28 inline int dontgenerate2 (void);
dontgenerate2(void)29 inline int dontgenerate2 (void)
30 {
31 return 2;
32 }
33
dontgenerate3(void)34 inline int dontgenerate3 (void)
35 {
36 return 3;
37 }
38 inline int dontgenerate3 (void);
39
func1(void)40 extern inline int func1 (void) { return 1; }
41
42 extern inline int func2 (void);
func2(void)43 inline int func2 (void) { return 2; }
44
func3(void)45 inline int func3 (void) { return 3; }
46 extern inline int func3 (void);
47
48 inline int func4 (void);
func4(void)49 extern inline int func4 (void) { return 4; }
50
func5(void)51 extern inline int func5 (void) { return 5; }
52 inline int func5 (void);
53
54 extern int func6 (void);
func6(void)55 inline int func6 (void) { return 6; }
56
func7(void)57 inline int func7 (void) { return 7; }
58 extern int func7 (void);
59
60 inline int func8 (void);
func8(void)61 extern int func8 (void) { return 8; }
62
func9(void)63 extern int func9 (void) { return 9; }
64 inline int func9 (void);
65