1; RUN: llc < %s | FileCheck %s --check-prefix=ASM
2; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ
3; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ
4; RUN: llc < %s -filetype=obj | obj2yaml | FileCheck %s --check-prefix=YAML
5
6; C++ source to regenerate:
7; $ cat a.cpp
8; int first;
9;
10; template <typename T> struct A { static const int comdat = 3; };
11;
12; thread_local const int *middle = &A<void>::comdat;
13;
14; namespace foo {
15; thread_local int globalTLS = 4;
16; static thread_local int staticTLS = 5;
17; int justGlobal = 6;
18; static int globalStatic = 7;
19; constexpr int constExpr = 8;
20; const int constVal = 9;
21;
22; struct Data {
23;   inline static thread_local int DataStaticTLS = 11;
24;   int DataGlobal = 12;
25;   inline static int DataStatic = 13;
26;   constexpr static int DataConstExpr = 14;
27;   const int DataConstVal = 15;
28; };
29; } // namespace foo
30;
31; int last;
32;
33; int bar() {
34;   struct Local {
35;     int LocalGlobal = 12;
36;     const int LocalConstVal = 15;
37;   };
38;   foo::Data D;
39;   Local L;
40;   return foo::globalStatic + foo::globalTLS + foo::staticTLS + foo::justGlobal +
41;          foo::globalStatic + foo::constExpr + foo::constVal + D.DataStaticTLS +
42;          D.DataGlobal + D.DataStatic + D.DataConstExpr + D.DataConstVal +
43;          L.LocalGlobal + L.LocalConstVal;
44; }
45;
46; $ clang-cl a.cpp /c /GS- /Z7 /GR- /std:c++17 /clang:-S /clang:-emit-llvm
47
48; ASM:        .section        .debug$S,"dr"
49; ASM-NEXT:   .p2align        2
50; ASM-NEXT:   .long   4                       # Debug section magic
51
52; ASM:        .short  4365                    # Record kind: S_GDATA32
53; ASM-NEXT:   .long   116                     # Type
54; ASM-NEXT:   .secrel32       "?first@@3HA"   # DataOffset
55; ASM-NEXT:   .secidx "?first@@3HA"           # Segment
56; ASM-NEXT:   .asciz  "first"                 # Name
57; ASM-NEXT:   .p2align        2
58
59; ASM:        .short  4371                    # Record kind: S_GTHREAD32
60; ASM-NEXT:   .long   4117                    # Type
61; ASM-NEXT:   .secrel32       "?middle@@3PEBHEB" # DataOffset
62; ASM-NEXT:   .secidx "?middle@@3PEBHEB"      # Segment
63; ASM-NEXT:   .asciz  "middle"                # Name
64; ASM-NEXT:   .p2align        2
65
66; ASM:        .short  4371                    # Record kind: S_GTHREAD32
67; ASM-NEXT:   .long   116                     # Type
68; ASM-NEXT:   .secrel32       "?globalTLS@foo@@3HA" # DataOffset
69; ASM-NEXT:   .secidx "?globalTLS@foo@@3HA"   # Segment
70; ASM-NEXT:   .asciz  "foo::globalTLS"        # Name
71; ASM-NEXT:   .p2align        2
72
73; ASM:        .short  4365                    # Record kind: S_GDATA32
74; ASM-NEXT:   .long   116                     # Type
75; ASM-NEXT:   .secrel32       "?justGlobal@foo@@3HA" # DataOffset
76; ASM-NEXT:   .secidx "?justGlobal@foo@@3HA"  # Segment
77; ASM-NEXT:   .asciz  "foo::justGlobal"       # Name
78; ASM-NEXT:   .p2align        2
79
80; ASM:        .short  4365                    # Record kind: S_GDATA32
81; ASM-NEXT:   .long   116                     # Type
82; ASM-NEXT:   .secrel32       "?last@@3HA"    # DataOffset
83; ASM-NEXT:   .secidx "?last@@3HA"            # Segment
84; ASM-NEXT:   .asciz  "last"                  # Name
85; ASM-NEXT:   .p2align        2
86
87; ASM:        .short	4359                    # Record kind: S_CONSTANT
88; ASM-NEXT:	  .long	4100                    # Type
89; ASM-NEXT:   .byte	0x00, 0x80, 0x08        # Value
90; ASM-NEXT:	  .asciz	"foo::constExpr"        # Name
91; ASM-NEXT:   .p2align	2
92
93; ASM:        .short	4359                    # Record kind: S_CONSTANT
94; ASM-NEXT:   .long	4100                    # Type
95; ASM-NEXT:   .byte	0x00, 0x80, 0x09        # Value
96; ASM-NEXT:   .asciz	"foo::constVal"         # Name
97; ASM-NEXT:   .p2align	2
98
99; ASM:        .short	4359                    # Record kind: S_CONSTANT
100; ASM-NEXT:   .long	4100                    # Type
101; ASM-NEXT:   .byte	0x00, 0x80, 0x0e        # Value
102; ASM-NEXT:   .asciz	"foo::Data::DataConstExpr" # Name
103; ASM-NEXT:   .p2align	2
104
105; ASM:        .short  4364                    # Record kind: S_LDATA32
106; ASM-NEXT:   .long   116                     # Type
107; ASM-NEXT:   .secrel32       "?globalStatic@foo@@3HA" # DataOffset
108; ASM-NEXT:   .secidx "?globalStatic@foo@@3HA" # Segment
109; ASM-NEXT:   .asciz  "foo::globalStatic"     # Name
110; ASM-NEXT:   .p2align        2
111
112; ASM:        .short  4370                    # Record kind: S_LTHREAD32
113; ASM-NEXT:   .long   116                     # Type
114; ASM-NEXT:   .secrel32       "?staticTLS@foo@@3HA" # DataOffset
115; ASM-NEXT:   .secidx "?staticTLS@foo@@3HA"   # Segment
116; ASM-NEXT:   .asciz  "foo::staticTLS"        # Name
117; ASM-NEXT:   .p2align        2
118
119; ASM:        .section        .debug$S,"dr",associative,"?comdat@?$A@X@@2HB"
120; ASM-NEXT:   .p2align        2
121; ASM-NEXT:   .long   4                       # Debug section magic
122
123; ASM:        .short  4365                    # Record kind: S_GDATA32
124; ASM-NEXT:   .long   4100                    # Type
125; ASM-NEXT:   .secrel32       "?comdat@?$A@X@@2HB" # DataOffset
126; ASM-NEXT:   .secidx "?comdat@?$A@X@@2HB"    # Segment
127; ASM-NEXT:   .asciz  "A<void>::comdat"       # Name
128
129; ASM:	      .section	.debug$S,"dr",associative,"?DataStaticTLS@Data@foo@@2HA"
130; ASM-NEXT:	  .p2align	2               # Symbol subsection for ?DataStaticTLS@Data@foo@@2HA
131
132; ASM:	      .short	4371                    # Record kind: S_GTHREAD32
133; ASM-NEXT:	  .long	116                     # Type
134; ASM-NEXT:	  .secrel32	"?DataStaticTLS@Data@foo@@2HA" # DataOffset
135; ASM-NEXT:	  .secidx	"?DataStaticTLS@Data@foo@@2HA" # Segment
136; ASM-NEXT:	  .asciz	"foo::Data::DataStaticTLS"         # Name
137; ASM-NEXT:   .p2align	2
138
139; ASM:        .section        .debug$S,"dr",associative,"?DataStatic@Data@foo@@2HA"
140; ASM-NEXT:   .p2align        2               # Symbol subsection for ?DataStatic@Data@foo@@2HA
141
142; ASM:        .short  4365                    # Record kind: S_GDATA32
143; ASM-NEXT:   .long   116                     # Type
144; ASM-NEXT:   .secrel32       "?DataStatic@Data@foo@@2HA" # DataOffset
145; ASM-NEXT:   .secidx "?DataStatic@Data@foo@@2HA" # Segment
146; ASM-NEXT:   .asciz  "foo::Data::DataStatic" # Name
147; ASM-NEXT:   .p2align        2
148
149; OBJ: CodeViewDebugInfo [
150; OBJ:   Section: .debug$S
151; OBJ:   Magic: 0x4
152; OBJ:   Subsection [
153
154; OBJ-LABEL:    GlobalData {
155; OBJ-NEXT:       Kind: S_GDATA32 (0x110D)
156; OBJ-NEXT:       DataOffset: ?first@@3HA+0x0
157; OBJ-NEXT:       Type: int (0x74)
158; OBJ-NEXT:       DisplayName: first
159; OBJ-NEXT:       LinkageName: ?first@@3HA
160; OBJ-NEXT:     }
161; OBJ-NEXT:     GlobalTLS {
162; OBJ-NEXT:       Kind: S_GTHREAD32 (0x1113)
163; OBJ-NEXT:       DataOffset: ?middle@@3PEBHEB+0x0
164; OBJ-NEXT:       Type: const int* (0x1015)
165; OBJ-NEXT:       DisplayName: middle
166; OBJ-NEXT:       LinkageName: ?middle@@3PEBHEB
167; OBJ-NEXT:     }
168; OBJ-NEXT:     GlobalTLS {
169; OBJ-NEXT:       Kind: S_GTHREAD32 (0x1113)
170; OBJ-NEXT:       DataOffset: ?globalTLS@foo@@3HA+0x0
171; OBJ-NEXT:       Type: int (0x74)
172; OBJ-NEXT:       DisplayName: foo::globalTLS
173; OBJ-NEXT:       LinkageName: ?globalTLS@foo@@3HA
174; OBJ-NEXT:     }
175; OBJ-NEXT:     GlobalData {
176; OBJ-NEXT:       Kind: S_GDATA32 (0x110D)
177; OBJ-NEXT:       DataOffset: ?justGlobal@foo@@3HA+0x0
178; OBJ-NEXT:       Type: int (0x74)
179; OBJ-NEXT:       DisplayName: foo::justGlobal
180; OBJ-NEXT:       LinkageName: ?justGlobal@foo@@3HA
181; OBJ-NEXT:     }
182; OBJ-NEXT:     GlobalData {
183; OBJ-NEXT:       Kind: S_GDATA32 (0x110D)
184; OBJ-NEXT:       DataOffset: ?last@@3HA+0x0
185; OBJ-NEXT:       Type: int (0x74)
186; OBJ-NEXT:       DisplayName: last
187; OBJ-NEXT:       LinkageName: ?last@@3HA
188; OBJ-NEXT:     }
189; OBJ-NEXT:    ConstantSym {
190; OBJ-NEXT:      Kind: S_CONSTANT (0x1107)
191; OBJ-NEXT:      Type: const int (0x1004)
192; OBJ-NEXT:      Value: 8
193; OBJ-NEXT:      Name: foo::constExpr
194; OBJ-NEXT:    }
195; OBJ-NEXT:    ConstantSym {
196; OBJ-NEXT:      Kind: S_CONSTANT (0x1107)
197; OBJ-NEXT:      Type: const int (0x1004)
198; OBJ-NEXT:      Value: 9
199; OBJ-NEXT:      Name: foo::constVal
200; OBJ-NEXT:    }
201; OBJ-NEXT:    ConstantSym {
202; OBJ-NEXT:      Kind: S_CONSTANT (0x1107)
203; OBJ-NEXT:      Type: const int (0x1004)
204; OBJ-NEXT:      Value: 14
205; OBJ-NEXT:      Name: foo::Data::DataConstExpr
206; OBJ-NEXT:    }
207; OBJ-NEXT:     DataSym {
208; OBJ-NEXT:       Kind: S_LDATA32 (0x110C)
209; OBJ-NEXT:       DataOffset: ?globalStatic@foo@@3HA+0x0
210; OBJ-NEXT:       Type: int (0x74)
211; OBJ-NEXT:       DisplayName: foo::globalStatic
212; OBJ-NEXT:       LinkageName: ?globalStatic@foo@@3HA
213; OBJ-NEXT:     }
214; OBJ-NEXT:     ThreadLocalDataSym {
215; OBJ-NEXT:       Kind: S_LTHREAD32 (0x1112)
216; OBJ-NEXT:       DataOffset: ?staticTLS@foo@@3HA+0x0
217; OBJ-NEXT:       Type: int (0x74)
218; OBJ-NEXT:       DisplayName: foo::staticTLS
219; OBJ-NEXT:       LinkageName: ?staticTLS@foo@@3HA
220; OBJ-NEXT:     }
221
222; OBJ:    GlobalData {
223; OBJ-NEXT:      Kind: S_GDATA32 (0x110D)
224; OBJ-LABEL:      DataOffset: ?comdat@?$A@X@@2HB+0x0
225; OBJ-NEXT:      Type: const int (0x1004)
226; OBJ-NEXT:      DisplayName: A<void>::comdat
227; OBJ-NEXT:      LinkageName: ?comdat@?$A@X@@2HB
228
229; OBJ:    GlobalTLS {
230; OBJ-NEXT:      Kind: S_GTHREAD32 (0x1113)
231; OBJ-NEXT:      DataOffset: ?DataStaticTLS@Data@foo@@2HA+0x0
232; OBJ-NEXT:      Type: int (0x74)
233; OBJ-NEXT:      DisplayName: foo::Data::DataStaticTLS
234; OBJ-NEXT:      LinkageName: ?DataStaticTLS@Data@foo@@2HA
235; OBJ-NEXT:    }
236
237; OBJ:    GlobalData {
238; OBJ-NEXT:      Kind: S_GDATA32 (0x110D)
239; OBJ-NEXT:      DataOffset: ?DataStatic@Data@foo@@2HA+0x0
240; OBJ-NEXT:      Type: int (0x74)
241; OBJ-NEXT:      DisplayName: foo::Data::DataStatic
242; OBJ-NEXT:      LinkageName: ?DataStatic@Data@foo@@2HA
243; OBJ-NEXT:    }
244
245; YAML-LABEL:  - Name:            '.debug$S'
246; YAML:    Subsections:
247; YAML:      - !Symbols
248; YAML:        Records:
249; YAML:          - Kind:            S_COMPILE3
250; YAML:            Compile3Sym:
251
252; YAML:      - !Symbols
253; YAML-NEXT:        Records:
254; YAML-LABEL:        - Kind:            S_GDATA32
255; YAML-NEXT:            DataSym:
256; YAML-NOT: Segment
257; YAML-NEXT:              Type:            116
258; YAML-NOT: Segment
259; YAML-NEXT:              DisplayName:     first
260; YAML-NOT: Segment
261; YAML-NEXT:          - Kind:            S_GTHREAD32
262; YAML-NEXT:            ThreadLocalDataSym:
263; YAML-NEXT:              Type:            4117
264; YAML-NEXT:              DisplayName:     middle
265; YAML-NEXT:          - Kind:            S_GTHREAD32
266; YAML-NEXT:            ThreadLocalDataSym:
267; YAML-NEXT:              Type:            116
268; YAML-NEXT:              DisplayName:     'foo::globalTLS'
269; YAML-NEXT:          - Kind:            S_GDATA32
270; YAML-NEXT:            DataSym:
271; YAML-NOT: Segment
272; YAML-NEXT:              Type:            116
273; YAML-NOT: Segment
274; YAML-NEXT:              DisplayName:     'foo::justGlobal'
275; YAML-NOT: Segment
276; YAML-NEXT:          - Kind:            S_GDATA32
277; YAML-NEXT:            DataSym:
278; YAML-NEXT:              Type:            116
279; YAML-NEXT:              DisplayName:     last
280; YAML-NEXT:          - Kind:            S_CONSTANT
281; YAML-NEXT:            ConstantSym:
282; YAML-NEXT:              Type:            4100
283; YAML-NEXT:              Value:           8
284; YAML-NEXT:              Name:            'foo::constExpr'
285; YAML-NEXT:          - Kind:            S_CONSTANT
286; YAML-NEXT:            ConstantSym:
287; YAML-NEXT:              Type:            4100
288; YAML-NEXT:              Value:           9
289; YAML-NEXT:              Name:            'foo::constVal'
290; YAML-NEXT:          - Kind:            S_CONSTANT
291; YAML-NEXT:            ConstantSym:
292; YAML-NEXT:              Type:            4100
293; YAML-NEXT:              Value:           14
294; YAML-NEXT:              Name:            'foo::Data::DataConstExpr'
295; YAML-NEXT:          - Kind:            S_LDATA32
296; YAML-NEXT:            DataSym:
297; YAML-NEXT:              Type:            116
298; YAML-NEXT:              DisplayName:     'foo::globalStatic'
299; YAML-NEXT:          - Kind:            S_LTHREAD32
300; YAML-NEXT:            ThreadLocalDataSym:
301; YAML-NEXT:              Type:            116
302; YAML-NEXT:              DisplayName:     'foo::staticTLS'
303
304; ModuleID = 'a.cpp'
305source_filename = "a.cpp"
306target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
307target triple = "x86_64-pc-windows-msvc19.25.28614"
308
309%"struct.foo::Data" = type { i32, i32 }
310%struct.Local = type { i32, i32 }
311
312$"??0Data@foo@@QEAA@XZ" = comdat any
313
314$"?comdat@?$A@X@@2HB" = comdat any
315
316$"?DataStaticTLS@Data@foo@@2HA" = comdat any
317
318$"?DataStatic@Data@foo@@2HA" = comdat any
319
320@"?first@@3HA" = dso_local global i32 0, align 4, !dbg !0
321@"?comdat@?$A@X@@2HB" = linkonce_odr dso_local constant i32 3, comdat, align 4, !dbg !17
322@"?middle@@3PEBHEB" = dso_local thread_local global i32* @"?comdat@?$A@X@@2HB", align 8, !dbg !24
323@"?globalTLS@foo@@3HA" = dso_local thread_local global i32 4, align 4, !dbg !27
324@"?justGlobal@foo@@3HA" = dso_local global i32 6, align 4, !dbg !29
325@"?last@@3HA" = dso_local global i32 0, align 4, !dbg !31
326@"?globalStatic@foo@@3HA" = internal global i32 7, align 4, !dbg !43
327@"?staticTLS@foo@@3HA" = internal thread_local global i32 5, align 4, !dbg !45
328@"?DataStaticTLS@Data@foo@@2HA" = linkonce_odr dso_local thread_local global i32 11, comdat, align 4, !dbg !37
329@"?DataStatic@Data@foo@@2HA" = linkonce_odr dso_local global i32 13, comdat, align 4, !dbg !39
330
331; Function Attrs: noinline nounwind optnone uwtable
332define dso_local i32 @"?bar@@YAHXZ"() #0 !dbg !54 {
333entry:
334  %D = alloca %"struct.foo::Data", align 4
335  %L = alloca %struct.Local, align 4
336  call void @llvm.dbg.declare(metadata %"struct.foo::Data"* %D, metadata !57, metadata !DIExpression()), !dbg !58
337  %call = call %"struct.foo::Data"* @"??0Data@foo@@QEAA@XZ"(%"struct.foo::Data"* %D) #2, !dbg !58
338  call void @llvm.dbg.declare(metadata %struct.Local* %L, metadata !59, metadata !DIExpression()), !dbg !64
339  %call1 = call %struct.Local* @"??0Local@?1??bar@@YAHXZ@QEAA@XZ"(%struct.Local* %L) #2, !dbg !64
340  %0 = load i32, i32* @"?globalStatic@foo@@3HA", align 4, !dbg !65
341  %1 = load i32, i32* @"?globalTLS@foo@@3HA", align 4, !dbg !65
342  %add = add nsw i32 %0, %1, !dbg !65
343  %2 = load i32, i32* @"?staticTLS@foo@@3HA", align 4, !dbg !65
344  %add2 = add nsw i32 %add, %2, !dbg !65
345  %3 = load i32, i32* @"?justGlobal@foo@@3HA", align 4, !dbg !65
346  %add3 = add nsw i32 %add2, %3, !dbg !65
347  %4 = load i32, i32* @"?globalStatic@foo@@3HA", align 4, !dbg !65
348  %add4 = add nsw i32 %add3, %4, !dbg !65
349  %add5 = add nsw i32 %add4, 8, !dbg !65
350  %add6 = add nsw i32 %add5, 9, !dbg !65
351  %5 = load i32, i32* @"?DataStaticTLS@Data@foo@@2HA", align 4, !dbg !65
352  %add7 = add nsw i32 %add6, %5, !dbg !65
353  %DataGlobal = getelementptr inbounds %"struct.foo::Data", %"struct.foo::Data"* %D, i32 0, i32 0, !dbg !65
354  %6 = load i32, i32* %DataGlobal, align 4, !dbg !65
355  %add8 = add nsw i32 %add7, %6, !dbg !65
356  %7 = load i32, i32* @"?DataStatic@Data@foo@@2HA", align 4, !dbg !65
357  %add9 = add nsw i32 %add8, %7, !dbg !65
358  %add10 = add nsw i32 %add9, 14, !dbg !65
359  %DataConstVal = getelementptr inbounds %"struct.foo::Data", %"struct.foo::Data"* %D, i32 0, i32 1, !dbg !65
360  %8 = load i32, i32* %DataConstVal, align 4, !dbg !65
361  %add11 = add nsw i32 %add10, %8, !dbg !65
362  %LocalGlobal = getelementptr inbounds %struct.Local, %struct.Local* %L, i32 0, i32 0, !dbg !65
363  %9 = load i32, i32* %LocalGlobal, align 4, !dbg !65
364  %add12 = add nsw i32 %add11, %9, !dbg !65
365  %LocalConstVal = getelementptr inbounds %struct.Local, %struct.Local* %L, i32 0, i32 1, !dbg !65
366  %10 = load i32, i32* %LocalConstVal, align 4, !dbg !65
367  %add13 = add nsw i32 %add12, %10, !dbg !65
368  ret i32 %add13, !dbg !65
369}
370
371; Function Attrs: nounwind readnone speculatable willreturn
372declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
373
374; Function Attrs: noinline nounwind optnone uwtable
375define linkonce_odr dso_local %"struct.foo::Data"* @"??0Data@foo@@QEAA@XZ"(%"struct.foo::Data"* returned %this) unnamed_addr #0 comdat align 2 !dbg !66 {
376entry:
377  %this.addr = alloca %"struct.foo::Data"*, align 8
378  store %"struct.foo::Data"* %this, %"struct.foo::Data"** %this.addr, align 8
379  call void @llvm.dbg.declare(metadata %"struct.foo::Data"** %this.addr, metadata !71, metadata !DIExpression()), !dbg !73
380  %this1 = load %"struct.foo::Data"*, %"struct.foo::Data"** %this.addr, align 8
381  %DataGlobal = getelementptr inbounds %"struct.foo::Data", %"struct.foo::Data"* %this1, i32 0, i32 0, !dbg !74
382  store i32 12, i32* %DataGlobal, align 4, !dbg !74
383  %DataConstVal = getelementptr inbounds %"struct.foo::Data", %"struct.foo::Data"* %this1, i32 0, i32 1, !dbg !74
384  store i32 15, i32* %DataConstVal, align 4, !dbg !74
385  ret %"struct.foo::Data"* %this1, !dbg !74
386}
387
388; Function Attrs: noinline nounwind optnone uwtable
389define internal %struct.Local* @"??0Local@?1??bar@@YAHXZ@QEAA@XZ"(%struct.Local* returned %this) unnamed_addr #0 align 2 !dbg !75 {
390entry:
391  %this.addr = alloca %struct.Local*, align 8
392  store %struct.Local* %this, %struct.Local** %this.addr, align 8
393  call void @llvm.dbg.declare(metadata %struct.Local** %this.addr, metadata !80, metadata !DIExpression()), !dbg !82
394  %this1 = load %struct.Local*, %struct.Local** %this.addr, align 8
395  %LocalGlobal = getelementptr inbounds %struct.Local, %struct.Local* %this1, i32 0, i32 0, !dbg !83
396  store i32 12, i32* %LocalGlobal, align 4, !dbg !83
397  %LocalConstVal = getelementptr inbounds %struct.Local, %struct.Local* %this1, i32 0, i32 1, !dbg !83
398  store i32 15, i32* %LocalConstVal, align 4, !dbg !83
399  ret %struct.Local* %this1, !dbg !83
400}
401
402attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
403attributes #1 = { nounwind readnone speculatable willreturn }
404attributes #2 = { nounwind }
405
406!llvm.dbg.cu = !{!2}
407!llvm.linker.options = !{!47, !48}
408!llvm.module.flags = !{!49, !50, !51, !52}
409!llvm.ident = !{!53}
410
411!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
412!1 = distinct !DIGlobalVariable(name: "first", linkageName: "?first@@3HA", scope: !2, file: !3, line: 1, type: !10, isLocal: false, isDefinition: true)
413!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !16, nameTableKind: None)
414!3 = !DIFile(filename: "a.cpp", directory: "F:\\llvm-project\\__test", checksumkind: CSK_MD5, checksum: "ae8137877dbd6fb10cfa1fc9ea4a39ca")
415!4 = !{}
416!5 = !{!6}
417!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Data", scope: !7, file: !3, line: 15, size: 64, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !8, identifier: ".?AUData@foo@@")
418!7 = !DINamespace(name: "foo", scope: null)
419!8 = !{!9, !11, !12, !13, !15}
420!9 = !DIDerivedType(tag: DW_TAG_member, name: "DataStaticTLS", scope: !6, file: !3, line: 16, baseType: !10, flags: DIFlagStaticMember, extraData: i32 11)
421!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
422!11 = !DIDerivedType(tag: DW_TAG_member, name: "DataGlobal", scope: !6, file: !3, line: 17, baseType: !10, size: 32)
423!12 = !DIDerivedType(tag: DW_TAG_member, name: "DataStatic", scope: !6, file: !3, line: 18, baseType: !10, flags: DIFlagStaticMember, extraData: i32 13)
424!13 = !DIDerivedType(tag: DW_TAG_member, name: "DataConstExpr", scope: !6, file: !3, line: 19, baseType: !14, flags: DIFlagStaticMember, extraData: i32 14)
425!14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !10)
426!15 = !DIDerivedType(tag: DW_TAG_member, name: "DataConstVal", scope: !6, file: !3, line: 20, baseType: !14, size: 32, offset: 32)
427!16 = !{!0, !17, !24, !27, !29, !31, !33, !35, !37, !39, !41, !43, !45}
428!17 = !DIGlobalVariableExpression(var: !18, expr: !DIExpression())
429!18 = distinct !DIGlobalVariable(name: "comdat", linkageName: "?comdat@?$A@X@@2HB", scope: !2, file: !3, line: 3, type: !14, isLocal: false, isDefinition: true, declaration: !19)
430!19 = !DIDerivedType(tag: DW_TAG_member, name: "comdat", scope: !20, file: !3, line: 3, baseType: !14, flags: DIFlagStaticMember, extraData: i32 3)
431!20 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A<void>", file: !3, line: 3, size: 8, flags: DIFlagTypePassByValue, elements: !21, templateParams: !22, identifier: ".?AU?$A@X@@")
432!21 = !{!19}
433!22 = !{!23}
434!23 = !DITemplateTypeParameter(name: "T", type: null)
435!24 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression())
436!25 = distinct !DIGlobalVariable(name: "middle", linkageName: "?middle@@3PEBHEB", scope: !2, file: !3, line: 5, type: !26, isLocal: false, isDefinition: true)
437!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64)
438!27 = !DIGlobalVariableExpression(var: !28, expr: !DIExpression())
439!28 = distinct !DIGlobalVariable(name: "globalTLS", linkageName: "?globalTLS@foo@@3HA", scope: !7, file: !3, line: 8, type: !10, isLocal: false, isDefinition: true)
440!29 = !DIGlobalVariableExpression(var: !30, expr: !DIExpression())
441!30 = distinct !DIGlobalVariable(name: "justGlobal", linkageName: "?justGlobal@foo@@3HA", scope: !7, file: !3, line: 10, type: !10, isLocal: false, isDefinition: true)
442!31 = !DIGlobalVariableExpression(var: !32, expr: !DIExpression())
443!32 = distinct !DIGlobalVariable(name: "last", linkageName: "?last@@3HA", scope: !2, file: !3, line: 24, type: !10, isLocal: false, isDefinition: true)
444!33 = !DIGlobalVariableExpression(var: !34, expr: !DIExpression(DW_OP_constu, 8, DW_OP_stack_value))
445!34 = distinct !DIGlobalVariable(name: "constExpr", scope: !7, file: !3, line: 12, type: !14, isLocal: true, isDefinition: true)
446!35 = !DIGlobalVariableExpression(var: !36, expr: !DIExpression(DW_OP_constu, 9, DW_OP_stack_value))
447!36 = distinct !DIGlobalVariable(name: "constVal", scope: !7, file: !3, line: 13, type: !14, isLocal: true, isDefinition: true)
448!37 = !DIGlobalVariableExpression(var: !38, expr: !DIExpression())
449!38 = distinct !DIGlobalVariable(name: "DataStaticTLS", linkageName: "?DataStaticTLS@Data@foo@@2HA", scope: !2, file: !3, line: 16, type: !10, isLocal: false, isDefinition: true, declaration: !9)
450!39 = !DIGlobalVariableExpression(var: !40, expr: !DIExpression())
451!40 = distinct !DIGlobalVariable(name: "DataStatic", linkageName: "?DataStatic@Data@foo@@2HA", scope: !2, file: !3, line: 18, type: !10, isLocal: false, isDefinition: true, declaration: !12)
452!41 = !DIGlobalVariableExpression(var: !42, expr: !DIExpression(DW_OP_constu, 14, DW_OP_stack_value))
453!42 = distinct !DIGlobalVariable(name: "DataConstExpr", scope: !2, file: !3, line: 19, type: !14, isLocal: true, isDefinition: true, declaration: !13)
454!43 = !DIGlobalVariableExpression(var: !44, expr: !DIExpression())
455!44 = distinct !DIGlobalVariable(name: "globalStatic", linkageName: "?globalStatic@foo@@3HA", scope: !7, file: !3, line: 11, type: !10, isLocal: true, isDefinition: true)
456!45 = !DIGlobalVariableExpression(var: !46, expr: !DIExpression())
457!46 = distinct !DIGlobalVariable(name: "staticTLS", linkageName: "?staticTLS@foo@@3HA", scope: !7, file: !3, line: 9, type: !10, isLocal: true, isDefinition: true)
458!47 = !{!"/DEFAULTLIB:libcmt.lib"}
459!48 = !{!"/DEFAULTLIB:oldnames.lib"}
460!49 = !{i32 2, !"CodeView", i32 1}
461!50 = !{i32 2, !"Debug Info Version", i32 3}
462!51 = !{i32 1, !"wchar_size", i32 2}
463!52 = !{i32 7, !"PIC Level", i32 2}
464!53 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 202f144bffd0be254a829924195e1b8ebabcbb79)"}
465!54 = distinct !DISubprogram(name: "bar", linkageName: "?bar@@YAHXZ", scope: !3, file: !3, line: 26, type: !55, scopeLine: 26, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
466!55 = !DISubroutineType(types: !56)
467!56 = !{!10}
468!57 = !DILocalVariable(name: "D", scope: !54, file: !3, line: 31, type: !6)
469!58 = !DILocation(line: 31, scope: !54)
470!59 = !DILocalVariable(name: "L", scope: !54, file: !3, line: 32, type: !60)
471!60 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Local", scope: !54, file: !3, line: 27, size: 64, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !61, identifier: ".?AULocal@?1??bar@@YAHXZ@")
472!61 = !{!62, !63}
473!62 = !DIDerivedType(tag: DW_TAG_member, name: "LocalGlobal", scope: !60, file: !3, line: 28, baseType: !10, size: 32)
474!63 = !DIDerivedType(tag: DW_TAG_member, name: "LocalConstVal", scope: !60, file: !3, line: 29, baseType: !14, size: 32, offset: 32)
475!64 = !DILocation(line: 32, scope: !54)
476!65 = !DILocation(line: 33, scope: !54)
477!66 = distinct !DISubprogram(name: "Data", linkageName: "??0Data@foo@@QEAA@XZ", scope: !6, file: !3, line: 15, type: !67, scopeLine: 15, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, declaration: !70, retainedNodes: !4)
478!67 = !DISubroutineType(types: !68)
479!68 = !{null, !69}
480!69 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
481!70 = !DISubprogram(name: "Data", scope: !6, type: !67, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: 0)
482!71 = !DILocalVariable(name: "this", arg: 1, scope: !66, type: !72, flags: DIFlagArtificial | DIFlagObjectPointer)
483!72 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64)
484!73 = !DILocation(line: 0, scope: !66)
485!74 = !DILocation(line: 15, scope: !66)
486!75 = distinct !DISubprogram(name: "Local", linkageName: "??0Local@?1??bar@@YAHXZ@QEAA@XZ", scope: !60, file: !3, line: 27, type: !76, scopeLine: 27, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, declaration: !79, retainedNodes: !4)
487!76 = !DISubroutineType(types: !77)
488!77 = !{null, !78}
489!78 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !60, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
490!79 = !DISubprogram(name: "Local", scope: !60, type: !76, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: 0)
491!80 = !DILocalVariable(name: "this", arg: 1, scope: !75, type: !81, flags: DIFlagArtificial | DIFlagObjectPointer)
492!81 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !60, size: 64)
493!82 = !DILocation(line: 0, scope: !75)
494!83 = !DILocation(line: 27, scope: !75)
495