summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/pr46123.C
blob: eee192c26873d8df8ef1e07fffab97ab4cb30af8 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// PR debug/46123
// { dg-do compile }
// { dg-options "-gdwarf-4" }

struct foo
{
  static int bar ()
  {
    int i;
    static int baz = 1;
    {
      static int baz = 2;
      i = baz++;
    }
    {
      struct baz
      {
	static int m ()
	{
	  static int n;
	  return n += 10;
	}
      };
      baz a;
      i += a.m ();
    }
    {
      static int baz = 3;
      i += baz;
      baz += 30;
    }
    i += baz;
    baz += 60;
    return i;
  }
};

int main ()
{
  foo x;

  if (x.bar () != 16)
    return 1;
  if (x.bar() != 117)
    return 1;
  return 0;
}