PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / inline-27.c
blob0ecfbcf5adf659968f811bf68ea62bea96d8bc3e
1 /* PR c/35017 */
2 /* { dg-do compile } */
3 /* { dg-options "-std=gnu89" } */
5 static int a = 6;
6 static const int b = 6;
7 int c = 6;
9 inline int
10 fn1 (void)
12 return a;
15 inline int
16 fn2 (void)
18 return b;
21 inline int
22 fn3 (void)
24 return c;
27 inline int
28 fn4 (void)
30 static int d = 6;
31 return d;
34 inline int
35 fn5 (void)
37 static const int e = 6;
38 return e;
41 inline int
42 fn6 (void)
44 int f = 6;
45 return f;
48 inline int
49 fn7 (int i)
51 static const char g[10] = "abcdefghij";
52 return g[i];
55 extern inline int
56 fn8 (void)
58 return a; /* { dg-warning "used in inline" } */
61 extern inline int
62 fn9 (void)
64 return b; /* { dg-warning "used in inline" } */
67 extern inline int
68 fn10 (void)
70 return c;
73 extern inline int
74 fn11 (void)
76 static int d = 6; /* { dg-warning "declared in inline" } */
77 return d;
80 extern inline int
81 fn12 (void)
83 static const int e = 6;
84 return e;
87 extern inline int
88 fn13 (void)
90 int f = 6;
91 return f;
94 extern inline int
95 fn14 (int i)
97 static const char g[10] = "abcdefghij";
98 return g[i];
101 static inline int
102 fn15 (void)
104 return a;
107 static inline int
108 fn16 (void)
110 return b;
113 static inline int
114 fn17 (void)
116 return c;
119 static inline int
120 fn18 (void)
122 static int d = 6;
123 return d;
126 static inline int
127 fn19 (void)
129 static const int e = 6;
130 return e;
133 static inline int
134 fn20 (void)
136 int f = 6;
137 return f;
140 static inline int
141 fn21 (int i)
143 static const char g[10] = "abcdefghij";
144 return g[i];