summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/localclass2.C
blob: 6e9a0664f17fc73c75dd7a07b60113d7ee096e31 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// PR c++/27017
// { dg-do compile }
// { dg-options "-gdwarf-2 -dA -O2 -feliminate-unused-debug-types -fno-merge-debug-strings" }

int
foo (int arg1)
{
  struct localstruct1
  {
    static inline int staticfn1 (int arg2)
    {
      int var2 = arg2 << 2;
      return arg2 + var2;
    }
    static int staticfn2 (int arg3)
    {
      int var3 = arg3 << 2;
      return arg3 + var3;
    }
    static inline int staticfn3 (int arg4)
    {
      int var4 = arg4 << 2;
      return arg4 + var4;
    }
    static int staticfn4 (int arg5)
    {
      int var5 = arg5 << 2;
      return arg5 + var5;
    }
    int method1 (int arg6)
    {
      int var6 = arg6 << 2;
      return arg6 + var6;
    }
  };
  struct localstruct2
  {
    static inline int staticfn5 (int arg7)
    {
      int var7 = arg7 << 2;
      return arg7 + var7;
    }
    static int staticfn6 (int arg8)
    {
      int var8 = arg8 << 2;
      return arg8 + var8;
    }
  };
  return localstruct1::staticfn1 (arg1) + localstruct1::staticfn2 (arg1);
}

int
main ()
{
  return foo (1) - 10;
}

// { dg-final { scan-assembler "main\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "foo\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "staticfn2\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn3\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn4\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn5\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "staticfn6\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "method1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg2\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "arg3\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "arg4\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "arg5\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "arg6\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "arg7\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "arg8\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler "localstruct1\[^\n\r\]*DW_AT_name" } }
// { dg-final { scan-assembler-not "localstruct2\[^\n\r\]*DW_AT_name" } }