annotate gcc/testsuite/gcc.dg/local1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* This is allowed, with the effect that the 'extern' declaration at block
kono
parents:
diff changeset
2 scope refers to the same object as the 'static' declaration at file scope.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 C90 6.1.2.2 [as corrected by TC1], C99 6.2.2:
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 For an identifier declared with the storage-class specifier
kono
parents:
diff changeset
7 extern in a scope in which a prior declaration of that
kono
parents:
diff changeset
8 identifier is visible, if the prior declaration specifies
kono
parents:
diff changeset
9 internal or external linkage, the linkage of the identifier at
kono
parents:
diff changeset
10 the later daclaration is the same as the linkage specified at
kono
parents:
diff changeset
11 the prior declaration. If no prior declaration is visible,
kono
parents:
diff changeset
12 or if the prior declaration specifies no linkage, then the
kono
parents:
diff changeset
13 identifer has external linkage.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 This is PR 14366. */
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 static int i;
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 extern int i;
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 static void f() {
kono
parents:
diff changeset
22 extern int i;
kono
parents:
diff changeset
23 }