Debian Codegraph @

gcc/testsuite/g++.dg/other/nested-extern-1.C

raw
1 /* { dg-do run } */
2 // { dg-additional-options "-fpermissive" }
3 // { dg-additional-sources "nested-extern-1.cc" }
4 /* PR 31775 */
5 extern int *p_otheri;
6 extern int *p;
7 int main()
8 {
9 extern int i; // { dg-message "previous declaration" }
10 i = 1;
11 *p = 2;
12 if (i != 2)
13 return 1;
14 if (p_otheri != p)
15 return 2;
16 return 0;
17 }
18
19 // This is extern because of the injection above.
20 static int i; // { dg-warning ".extern. and later .static" }
21 int *p = &i;