Debian Codegraph @

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

raw
1 /* { dg-do run } */
2 /* PR 31775 */
3 // { dg-additional-sources "nested-extern-2.cc" }
4 extern int *p_otheri;
5 static int i; // #1
6 int *p_si = &i;
7 int main()
8 {
9 int i;
10 int *p_ai = &i;
11 {
12 // This is an alias of #1, not a different object
13 extern int i;
14 int *p_ei = &i;
15
16 *p_si = 1;
17 *p_ai = 2;
18 *p_ei = 3;
19 if (*p_si != 3)
20 return 1;
21 if (*p_ai != 2)
22 return 2;
23 if (*p_otheri != 17)
24 return 3;
25 }
26 return 0;
27 }