xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug_static-member-anonymous-namespace.s (revision fc440f27cd50e48e1f9ebe6e56febe2823e59de4)
1# RUN: llvm-mc --triple=x86_64-pc-linux --filetype=obj %s -o %t
2# RUN: %lldb -o "target variable ug U::s" -b %t | FileCheck %s
3
4# CHECK: (lldb) target variable ug
5# CHECK: (U) ug = (m = 14159265)
6# CHECK: (int) U::s = 65295141
7
8# This tests that a static member in a class declared in the anonymous namespace
9# does not appear as a field of the class. There is a difference between the
10# debug info generated by gcc and clang, where clang flags the static member
11# with DW_AT_external, but gcc does not.
12#
13# Roughly corresponds to this source code:
14#
15# namespace {
16# struct U {
17#   static int s;
18#   int m = 14159265;
19# };
20# int U::s = 65295141;
21# }
22#
23# U ug;
24
25        .file   "test.cpp"
26        .data
27        .quad 0
28ug:
29        .long 14159265
30.Lug_s:
31        .long 65295141
32
33        .section        .debug_info,"",@progbits
34.Ldebug_info0:
35        .long   .Lcu_end-.Lcu_begin
36.Lcu_begin:
37        .value  0x4
38        .long   .Ldebug_abbrev0
39        .byte   0x8
40        .uleb128 0x1
41        .asciz  "GCC DWARF reduced by hand"
42        .byte   0x4
43        .asciz  "test.cpp"
44        .uleb128 0x2
45.LU:
46        .uleb128 0x3
47        .string "U"
48        .byte   0x4
49.LU_s:
50        .uleb128 0x4
51        .string "s"
52        .long   .Lint-.Ldebug_info0
53        .uleb128 0x5
54        .string "m"
55        .long   .Lint-.Ldebug_info0
56        .byte   0
57        .byte   0
58        .byte   0
59        .uleb128 0x6
60        .long   0x2d
61.Lint:
62        .uleb128 0x7
63        .byte   0x4
64        .byte   0x5
65        .string "int"
66        .uleb128 0x9
67        .string "ug"
68        .long   .LU-.Ldebug_info0
69        .uleb128 0x9
70        .byte   0x3
71        .quad   ug
72        .uleb128 0xa
73        .long   .LU_s-.Ldebug_info0
74        .uleb128 0x9
75        .byte   0x3
76        .quad .Lug_s
77        .byte   0
78.Lcu_end:
79        .section        .debug_abbrev,"",@progbits
80.Ldebug_abbrev0:
81        .uleb128 0x1
82        .uleb128 0x11
83        .byte   0x1
84        .uleb128 0x25
85        .uleb128 0x8
86        .uleb128 0x13
87        .uleb128 0xb
88        .uleb128 0x3
89        .uleb128 0x8
90        .byte   0
91        .byte   0
92        .uleb128 0x2
93        .uleb128 0x39
94        .byte   0x1
95        .byte   0
96        .byte   0
97        .uleb128 0x3
98        .uleb128 0x13
99        .byte   0x1
100        .uleb128 0x3
101        .uleb128 0x8
102        .uleb128 0xb
103        .uleb128 0xb
104        .byte   0
105        .byte   0
106        .uleb128 0x4
107        .uleb128 0xd
108        .byte   0
109        .uleb128 0x3
110        .uleb128 0x8
111        .uleb128 0x49
112        .uleb128 0x13
113        .uleb128 0x3c
114        .uleb128 0x19
115        .byte   0
116        .byte   0
117        .uleb128 0x5
118        .uleb128 0xd
119        .byte   0
120        .uleb128 0x3
121        .uleb128 0x8
122        .uleb128 0x49
123        .uleb128 0x13
124        .uleb128 0x38
125        .uleb128 0xb
126        .byte   0
127        .byte   0
128        .uleb128 0x6
129        .uleb128 0x3a
130        .byte   0
131        .uleb128 0x18
132        .uleb128 0x13
133        .byte   0
134        .byte   0
135        .uleb128 0x7
136        .uleb128 0x24
137        .byte   0
138        .uleb128 0xb
139        .uleb128 0xb
140        .uleb128 0x3e
141        .uleb128 0xb
142        .uleb128 0x3
143        .uleb128 0x8
144        .byte   0
145        .byte   0
146        .uleb128 0x8
147        .uleb128 0x26
148        .byte   0
149        .uleb128 0x49
150        .uleb128 0x13
151        .byte   0
152        .byte   0
153        .uleb128 0x9
154        .uleb128 0x34
155        .byte   0
156        .uleb128 0x3
157        .uleb128 0x8
158        .uleb128 0x49
159        .uleb128 0x13
160        .uleb128 0x2
161        .uleb128 0x18
162        .byte   0
163        .byte   0
164	.uleb128 0xa
165	.uleb128 0x34
166	.byte	0
167	.uleb128 0x47
168	.uleb128 0x13
169	.uleb128 0x2
170	.uleb128 0x18
171	.byte	0
172	.byte	0
173        .byte   0
174