summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/guality/redeclaration1.C
blob: 93b0750b93c33b29ea28000ee0c2df1c2ce5aa64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do run }
// { dg-options "-g" }
// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }

volatile int l;

namespace S
{
  int i = 24;
  void __attribute__((noinline))
  f()
  {
    int i = 42;
    l = i;		// { dg-final { gdb-test 14 "i" "42" } }
    {
      extern int i;
      l = i;		// { dg-final { gdb-test 17 "i" "24" } }
    }
  }
}

int
main (void)
{
  S::f ();
  return 0;
}