Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/inline-25.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* PR c/35017 */ | |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ | |
4 | |
5 static int a = 6; | |
6 static const int b = 6; | |
7 int c = 6; | |
8 | |
9 inline int | |
10 fn1 (void) | |
11 { | |
12 return a; /* { dg-error "used in inline" } */ | |
13 } | |
14 | |
15 inline int | |
16 fn2 (void) | |
17 { | |
18 return b; /* { dg-error "used in inline" } */ | |
19 } | |
20 | |
21 inline int | |
22 fn3 (void) | |
23 { | |
24 return c; | |
25 } | |
26 | |
27 inline int | |
28 fn4 (void) | |
29 { | |
30 static int d = 6; /* { dg-error "declared in inline" } */ | |
31 return d; | |
32 } | |
33 | |
34 inline int | |
35 fn5 (void) | |
36 { | |
37 static const int e = 6; | |
38 return e; | |
39 } | |
40 | |
41 inline int | |
42 fn6 (void) | |
43 { | |
44 int f = 6; | |
45 return f; | |
46 } | |
47 | |
48 inline int | |
49 fn7 (int i) | |
50 { | |
51 static const char g[10] = "abcdefghij"; | |
52 return g[i]; | |
53 } | |
54 | |
55 extern inline int | |
56 fn8 (void) | |
57 { | |
58 return a; | |
59 } | |
60 | |
61 extern inline int | |
62 fn9 (void) | |
63 { | |
64 return b; | |
65 } | |
66 | |
67 extern inline int | |
68 fn10 (void) | |
69 { | |
70 return c; | |
71 } | |
72 | |
73 extern inline int | |
74 fn11 (void) | |
75 { | |
76 static int d = 6; | |
77 return d; | |
78 } | |
79 | |
80 extern inline int | |
81 fn12 (void) | |
82 { | |
83 static const int e = 6; | |
84 return e; | |
85 } | |
86 | |
87 extern inline int | |
88 fn13 (void) | |
89 { | |
90 int f = 6; | |
91 return f; | |
92 } | |
93 | |
94 extern inline int | |
95 fn14 (int i) | |
96 { | |
97 static const char g[10] = "abcdefghij"; | |
98 return g[i]; | |
99 } | |
100 | |
101 static inline int | |
102 fn15 (void) | |
103 { | |
104 return a; | |
105 } | |
106 | |
107 static inline int | |
108 fn16 (void) | |
109 { | |
110 return b; | |
111 } | |
112 | |
113 static inline int | |
114 fn17 (void) | |
115 { | |
116 return c; | |
117 } | |
118 | |
119 static inline int | |
120 fn18 (void) | |
121 { | |
122 static int d = 6; | |
123 return d; | |
124 } | |
125 | |
126 static inline int | |
127 fn19 (void) | |
128 { | |
129 static const int e = 6; | |
130 return e; | |
131 } | |
132 | |
133 static inline int | |
134 fn20 (void) | |
135 { | |
136 int f = 6; | |
137 return f; | |
138 } | |
139 | |
140 static inline int | |
141 fn21 (int i) | |
142 { | |
143 static const char g[10] = "abcdefghij"; | |
144 return g[i]; | |
145 } |