summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/nested-extern-2.C
blob: 58f53e083f9decd7325a51ab5c455d5f3c4246fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do run } */
// { dg-additional-sources "nested-extern.cc" }
/* PR 31775 */
extern "C" void abort();
static int i;
int *p = &i;
int main()
{ 
  int i;
  { 
    extern int i;
    i = 1;
    *p = 2;
    if (i == 2)
      abort ();
  }
  return 0;
}