xref: /llvm-project/llvm/test/DebugInfo/COFF/type-quals.ll (revision 3a05e01d1a76984fe1532bd237edbbb7ed9db6ea)
1; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
3
4; RUN: llc --try-experimental-debuginfo-iterators < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
5; RUN: llc --try-experimental-debuginfo-iterators < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
6
7; C++ source to regenerate:
8; $ cat m.cpp
9; union Union {
10;   int * __restrict x_member;
11;   float * __restrict y_member;
12;   int* volatile __restrict m_volatile;
13; };
14;
15; int f(const volatile int* __restrict arg_crv) {
16;   Union u;
17;   const int *p;
18;   const volatile int v = 0;
19;   return 1;
20; }
21;
22; void g(int& __restrict arg_ref) {
23;   const int x = 10;
24;   const char str[] = "abc";
25; }
26;
27; void h() {
28;   struct Foo {
29;     int a;
30;     int func(int x) __restrict { return 1; }
31;   };
32;
33;   Foo s = { 10 };
34;
35;   int* __restrict p_object = &s.a;
36;
37;   int Foo:: * __restrict p_data_member = &Foo::a;
38;
39;   int (Foo::* p_member_func)(int) __restrict = &Foo::func;
40; }
41;
42; $ clang++ m.cpp -S -emit-llvm -g -gcodeview -o m.ll
43
44
45; CHECK: CodeViewTypes [
46; CHECK:   Section: .debug$T (7)
47; CHECK:   Magic: 0x4
48; CHECK:   Modifier (0x1000) {
49; CHECK:     TypeLeafKind: LF_MODIFIER (0x1001)
50; CHECK:     ModifiedType: int (0x74)
51; CHECK:     Modifiers [ (0x3)
52; CHECK:       Const (0x1)
53; CHECK:       Volatile (0x2)
54; CHECK:     ]
55; CHECK:   }
56; CHECK:   Pointer (0x1001) {
57; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
58; CHECK:     PointeeType: const volatile int (0x1000)
59; CHECK:     PtrType: Near64 (0xC)
60; CHECK:     PtrMode: Pointer (0x0)
61; CHECK:     IsFlat: 0
62; CHECK:     IsConst: 0
63; CHECK:     IsVolatile: 0
64; CHECK:     IsUnaligned: 0
65; CHECK:     IsRestrict: 1
66; CHECK:     SizeOf: 8
67; CHECK:   }
68; CHECK:   ArgList (0x1002) {
69; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
70; CHECK:     NumArgs: 1
71; CHECK:     Arguments [
72; CHECK:       ArgType: const volatile int* __restrict (0x1001)
73; CHECK:     ]
74; CHECK:   }
75; CHECK:   Procedure (0x1003) {
76; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
77; CHECK:     ReturnType: int (0x74)
78; CHECK:     CallingConvention: NearC (0x0)
79; CHECK:     FunctionOptions [ (0x0)
80; CHECK:     ]
81; CHECK:     NumParameters: 1
82; CHECK:     ArgListType: (const volatile int* __restrict) (0x1002)
83; CHECK:   }
84; CHECK:   FuncId (0x1004) {
85; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
86; CHECK:     ParentScope: 0x0
87; CHECK:     FunctionType: int (const volatile int* __restrict) (0x1003)
88; CHECK:     Name: f
89; CHECK:   }
90; CHECK:   Union (0x1005) {
91; CHECK:     TypeLeafKind: LF_UNION (0x1506)
92; CHECK:     MemberCount: 0
93; CHECK:     Properties [ (0x280)
94; CHECK:       ForwardReference (0x80)
95; CHECK:       HasUniqueName (0x200)
96; CHECK:     ]
97; CHECK:     FieldList: 0x0
98; CHECK:     SizeOf: 0
99; CHECK:     Name: Union
100; CHECK:     LinkageName: .?ATUnion@@
101; CHECK:   }
102; CHECK:   Pointer (0x1006) {
103; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
104; CHECK:     PointeeType: int (0x74)
105; CHECK:     PtrType: Near64 (0xC)
106; CHECK:     PtrMode: Pointer (0x0)
107; CHECK:     IsFlat: 0
108; CHECK:     IsConst: 0
109; CHECK:     IsVolatile: 0
110; CHECK:     IsUnaligned: 0
111; CHECK:     IsRestrict: 1
112; CHECK:     SizeOf: 8
113; CHECK:   }
114; CHECK:   Pointer (0x1007) {
115; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
116; CHECK:     PointeeType: float (0x40)
117; CHECK:     PtrType: Near64 (0xC)
118; CHECK:     PtrMode: Pointer (0x0)
119; CHECK:     IsFlat: 0
120; CHECK:     IsConst: 0
121; CHECK:     IsVolatile: 0
122; CHECK:     IsUnaligned: 0
123; CHECK:     IsRestrict: 1
124; CHECK:     SizeOf: 8
125; CHECK:   }
126; CHECK:   Pointer (0x1008) {
127; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
128; CHECK:     PointeeType: int (0x74)
129; CHECK:     PtrType: Near64 (0xC)
130; CHECK:     PtrMode: Pointer (0x0)
131; CHECK:     IsFlat: 0
132; CHECK:     IsConst: 0
133; CHECK:     IsVolatile: 1
134; CHECK:     IsUnaligned: 0
135; CHECK:     IsRestrict: 1
136; CHECK:     SizeOf: 8
137; CHECK:   }
138; CHECK:   FieldList (0x1009) {
139; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)
140; CHECK:     DataMember {
141; CHECK:       TypeLeafKind: LF_MEMBER (0x150D)
142; CHECK:       AccessSpecifier: Public (0x3)
143; CHECK:       Type: int* __restrict (0x1006)
144; CHECK:       FieldOffset: 0x0
145; CHECK:       Name: x_member
146; CHECK:     }
147; CHECK:     DataMember {
148; CHECK:       TypeLeafKind: LF_MEMBER (0x150D)
149; CHECK:       AccessSpecifier: Public (0x3)
150; CHECK:       Type: float* __restrict (0x1007)
151; CHECK:       FieldOffset: 0x0
152; CHECK:       Name: y_member
153; CHECK:     }
154; CHECK:     DataMember {
155; CHECK:       TypeLeafKind: LF_MEMBER (0x150D)
156; CHECK:       AccessSpecifier: Public (0x3)
157; CHECK:       Type: int* volatile __restrict (0x1008)
158; CHECK:       FieldOffset: 0x0
159; CHECK:       Name: m_volatile
160; CHECK:     }
161; CHECK:   }
162
163; CHECK:   Modifier (0x100D) {
164; CHECK:     TypeLeafKind: LF_MODIFIER (0x1001)
165; CHECK:     ModifiedType: int (0x74)
166; CHECK:     Modifiers [ (0x1)
167; CHECK:       Const (0x1)
168; CHECK:     ]
169; CHECK:   }
170; CHECK:   Pointer (0x100E) {
171; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
172; CHECK:     PointeeType: const int (0x100D)
173; CHECK:     PtrType: Near64 (0xC)
174; CHECK:     PtrMode: Pointer (0x0)
175; CHECK:     IsFlat: 0
176; CHECK:     IsConst: 0
177; CHECK:     IsVolatile: 0
178; CHECK:     IsUnaligned: 0
179; CHECK:     IsRestrict: 0
180; CHECK:     SizeOf: 8
181; CHECK:   }
182; CHECK:   Pointer (0x100F) {
183; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
184; CHECK:     PointeeType: int (0x74)
185; CHECK:     PtrType: Near64 (0xC)
186; CHECK:     PtrMode: LValueReference (0x1)
187; CHECK:     IsFlat: 0
188; CHECK:     IsConst: 0
189; CHECK:     IsVolatile: 0
190; CHECK:     IsUnaligned: 0
191; CHECK:     IsRestrict: 1
192; CHECK:     SizeOf: 8
193; CHECK:   }
194; CHECK:   ArgList (0x1010) {
195; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
196; CHECK:     NumArgs: 1
197; CHECK:     Arguments [
198; CHECK:       ArgType: int& __restrict (0x100F)
199; CHECK:     ]
200; CHECK:   }
201; CHECK:   Procedure (0x1011) {
202; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
203; CHECK:     ReturnType: void (0x3)
204; CHECK:     CallingConvention: NearC (0x0)
205; CHECK:     FunctionOptions [ (0x0)
206; CHECK:     ]
207; CHECK:     NumParameters: 1
208; CHECK:     ArgListType: (int& __restrict) (0x1010)
209; CHECK:   }
210; CHECK:   FuncId (0x1012) {
211; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
212; CHECK:     ParentScope: 0x0
213; CHECK:     FunctionType: void (int& __restrict) (0x1011)
214; CHECK:     Name: g
215; CHECK:   }
216; CHECK:   Modifier (0x1013) {
217; CHECK:     TypeLeafKind: LF_MODIFIER (0x1001)
218; CHECK:     ModifiedType: char (0x70)
219; CHECK:     Modifiers [ (0x1)
220; CHECK:       Const (0x1)
221; CHECK:     ]
222; CHECK:   }
223; CHECK:   Array (0x1014) {
224; CHECK:     TypeLeafKind: LF_ARRAY (0x1503)
225; CHECK:     ElementType: const char (0x1013)
226; CHECK:     IndexType: unsigned __int64 (0x23)
227; CHECK:     SizeOf: 4
228; CHECK:     Name:
229; CHECK:   }
230; CHECK:   ArgList (0x1015) {
231; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
232; CHECK:     NumArgs: 0
233; CHECK:     Arguments [
234; CHECK:     ]
235; CHECK:   }
236; CHECK:   Procedure (0x1016) {
237; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
238; CHECK:     ReturnType: void (0x3)
239; CHECK:     CallingConvention: NearC (0x0)
240; CHECK:     FunctionOptions [ (0x0)
241; CHECK:     ]
242; CHECK:     NumParameters: 0
243; CHECK:     ArgListType: () (0x1015)
244; CHECK:   }
245; CHECK:   FuncId (0x1017) {
246; CHECK:     TypeLeafKind: LF_FUNC_ID (0x1601)
247; CHECK:     ParentScope: 0x0
248; CHECK:     FunctionType: void () (0x1016)
249; CHECK:     Name: h
250; CHECK:   }
251; CHECK:   Struct (0x1018) {
252; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)
253; CHECK:     MemberCount: 0
254; CHECK:     Properties [ (0x180)
255; CHECK:       ForwardReference (0x80)
256; CHECK:       Scoped (0x100)
257; CHECK:     ]
258; CHECK:     FieldList: 0x0
259; CHECK:     DerivedFrom: 0x0
260; CHECK:     VShape: 0x0
261; CHECK:     SizeOf: 0
262; CHECK:     Name: h::Foo
263; CHECK:   }
264; CHECK:   Pointer (0x1019) {
265; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
266; CHECK:     PointeeType: h::Foo (0x1018)
267; CHECK:     PtrType: Near64 (0xC)
268; CHECK:     PtrMode: Pointer (0x0)
269; CHECK:     IsFlat: 0
270; CHECK:     IsConst: 1
271; CHECK:     IsVolatile: 0
272; CHECK:     IsUnaligned: 0
273; CHECK:     IsRestrict: 0
274; CHECK:     SizeOf: 8
275; CHECK:   }
276; CHECK:   ArgList (0x101A) {
277; CHECK:     TypeLeafKind: LF_ARGLIST (0x1201)
278; CHECK:     NumArgs: 1
279; CHECK:     Arguments [
280; CHECK:       ArgType: int (0x74)
281; CHECK:     ]
282; CHECK:   }
283; CHECK:   MemberFunction (0x101B) {
284; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)
285; CHECK:     ReturnType: int (0x74)
286; CHECK:     ClassType: h::Foo (0x1018)
287; CHECK:     ThisType: h::Foo* const (0x1019)
288; CHECK:     CallingConvention: NearC (0x0)
289; CHECK:     FunctionOptions [ (0x0)
290; CHECK:     ]
291; CHECK:     NumParameters: 1
292; CHECK:     ArgListType: (int) (0x101A)
293; CHECK:     ThisAdjustment: 0
294; CHECK:   }
295; CHECK:   FieldList (0x101C) {
296; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)
297; CHECK:     DataMember {
298; CHECK:       TypeLeafKind: LF_MEMBER (0x150D)
299; CHECK:       AccessSpecifier: Public (0x3)
300; CHECK:       Type: int (0x74)
301; CHECK:       FieldOffset: 0x0
302; CHECK:       Name: a
303; CHECK:     }
304; CHECK:     OneMethod {
305; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
306; CHECK:       AccessSpecifier: Public (0x3)
307; CHECK:       Type: int h::Foo::(int) (0x101B)
308; CHECK:       Name: func
309; CHECK:     }
310; CHECK:   }
311; CHECK:   Struct (0x101D) {
312; CHECK:     TypeLeafKind: LF_STRUCTURE (0x1505)
313; CHECK:     MemberCount: 2
314; CHECK:     Properties [ (0x100)
315; CHECK:       Scoped (0x100)
316; CHECK:     ]
317; CHECK:     FieldList: <field list> (0x101C)
318; CHECK:     DerivedFrom: 0x0
319; CHECK:     VShape: 0x0
320; CHECK:     SizeOf: 4
321; CHECK:     Name: h::Foo
322; CHECK:   }
323
324; CHECK:   Pointer (0x101F) {
325; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
326; CHECK:     PointeeType: int (0x74)
327; CHECK:     PtrType: Near64 (0xC)
328; CHECK:     PtrMode: PointerToDataMember (0x2)
329; CHECK:     IsFlat: 0
330; CHECK:     IsConst: 0
331; CHECK:     IsVolatile: 0
332; CHECK:     IsUnaligned: 0
333; CHECK:     IsRestrict: 1
334; CHECK:     SizeOf: 4
335; CHECK:     ClassType: h::Foo (0x1018)
336; CHECK:     Representation: SingleInheritanceData (0x1)
337; CHECK:   }
338; CHECK:   Pointer (0x1020) {
339; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
340; CHECK:     PointeeType: int h::Foo::(int) (0x101B)
341; CHECK:     PtrType: Near64 (0xC)
342; CHECK:     PtrMode: PointerToMemberFunction (0x3)
343; CHECK:     IsFlat: 0
344; CHECK:     IsConst: 0
345; CHECK:     IsVolatile: 0
346; CHECK:     IsUnaligned: 0
347; CHECK:     IsRestrict: 0
348; CHECK:     SizeOf: 8
349; CHECK:     ClassType: h::Foo (0x1018)
350; CHECK:     Representation: SingleInheritanceFunction (0x5)
351; CHECK:   }
352; CHECK:   MemberFuncId (0x1021) {
353; CHECK:     TypeLeafKind: LF_MFUNC_ID (0x1602)
354; CHECK:     ClassType: h::Foo (0x1018)
355; CHECK:     FunctionType: int h::Foo::(int) (0x101B)
356; CHECK:     Name: func
357; CHECK:   }
358; CHECK:   Pointer (0x1022) {
359; CHECK:     TypeLeafKind: LF_POINTER (0x1002)
360; CHECK:     PointeeType: h::Foo (0x1018)
361; CHECK:     PtrType: Near64 (0xC)
362; CHECK:     PtrMode: Pointer (0x0)
363; CHECK:     IsFlat: 0
364; CHECK:     IsConst: 0
365; CHECK:     IsVolatile: 0
366; CHECK:     IsUnaligned: 0
367; CHECK:     IsRestrict: 0
368; CHECK:     SizeOf: 8
369; CHECK:   }
370; CHECK: ]
371
372; CHECK-LABEL: CodeViewDebugInfo [
373; CHECK-NEXT:   Section: .debug$S (6)
374; CHECK:   Subsection [
375; CHECK:     SubSectionType: Symbols (0xF1)
376; CHECK:     GlobalProcIdSym {
377; CHECK:       Kind: S_GPROC32_ID (0x1147)
378; CHECK:       FunctionType: f ({{.*}})
379; CHECK:       CodeOffset: ?f@@YAHPEIDH@Z+0x0
380; CHECK:       DisplayName: f
381; CHECK:       LinkageName: ?f@@YAHPEIDH@Z
382; CHECK:     }
383; CHECK:     LocalSym {
384; CHECK:       Kind: S_LOCAL (0x113E)
385; CHECK:       Type: const volatile int* __restrict (0x1001)
386; CHECK:       VarName: arg_crv
387; CHECK:     }
388; CHECK:     LocalSym {
389; CHECK:       Kind: S_LOCAL (0x113E)
390; CHECK:       Type: Union (0x100A)
391; CHECK:       VarName: u
392; CHECK:     }
393; CHECK:     LocalSym {
394; CHECK:       Kind: S_LOCAL (0x113E)
395; CHECK:       Type: const int* (0x100E)
396; CHECK:       VarName: p
397; CHECK:     }
398; CHECK:     LocalSym {
399; CHECK:       Kind: S_LOCAL (0x113E)
400; CHECK:       Type: const volatile int (0x1000)
401; CHECK:       VarName: v
402; CHECK:     }
403
404; ModuleID = 'm.cpp'
405source_filename = "m.cpp"
406target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
407target triple = "x86_64-pc-windows-msvc19.11.25507"
408
409%struct.Foo = type { i32 }
410%union.Union = type { ptr }
411
412@"\01?str@?1??g@@YAXAEIAH@Z@3QBDB" = internal constant [4 x i8] c"abc\00", align 1, !dbg !0
413@"\01?s@?1??h@@YAXXZ@3UFoo@?1??1@YAXXZ@A" = private unnamed_addr constant %struct.Foo { i32 10 }, align 4
414
415; Function Attrs: noinline nounwind optnone uwtable
416define i32 @"\01?f@@YAHPEIDH@Z"(ptr noalias %arg_crv) #0 !dbg !22 {
417entry:
418  %arg_crv.addr = alloca ptr, align 8
419  %u = alloca %union.Union, align 8
420  %p = alloca ptr, align 8
421  %v = alloca i32, align 4
422  store ptr %arg_crv, ptr %arg_crv.addr, align 8
423  call void @llvm.dbg.declare(metadata ptr %arg_crv.addr, metadata !29, metadata !DIExpression()), !dbg !30
424  call void @llvm.dbg.declare(metadata ptr %u, metadata !31, metadata !DIExpression()), !dbg !43
425  call void @llvm.dbg.declare(metadata ptr %p, metadata !44, metadata !DIExpression()), !dbg !47
426  call void @llvm.dbg.declare(metadata ptr %v, metadata !48, metadata !DIExpression()), !dbg !49
427  store volatile i32 0, ptr %v, align 4, !dbg !49
428  ret i32 1, !dbg !50
429}
430
431; Function Attrs: nounwind readnone speculatable
432declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
433
434; Function Attrs: noinline nounwind optnone uwtable
435define void @"\01?g@@YAXAEIAH@Z"(ptr noalias dereferenceable(4) %arg_ref) #0 !dbg !2 {
436entry:
437  %arg_ref.addr = alloca ptr, align 8
438  %x = alloca i32, align 4
439  store ptr %arg_ref, ptr %arg_ref.addr, align 8
440  call void @llvm.dbg.declare(metadata ptr %arg_ref.addr, metadata !51, metadata !DIExpression()), !dbg !52
441  call void @llvm.dbg.declare(metadata ptr %x, metadata !53, metadata !DIExpression()), !dbg !54
442  store i32 10, ptr %x, align 4, !dbg !54
443  ret void, !dbg !55
444}
445
446; Function Attrs: noinline nounwind optnone uwtable
447define void @"\01?h@@YAXXZ"() #0 !dbg !56 {
448entry:
449  %s = alloca %struct.Foo, align 4
450  %p_object = alloca ptr, align 8
451  %p_data_member = alloca i32, align 8
452  %p_member_func = alloca ptr, align 8
453  call void @llvm.dbg.declare(metadata ptr %s, metadata !59, metadata !DIExpression()), !dbg !68
454  %0 = bitcast ptr %s to ptr, !dbg !68
455  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 @"\01?s@?1??h@@YAXXZ@3UFoo@?1??1@YAXXZ@A", i64 4, i1 false), !dbg !68
456  call void @llvm.dbg.declare(metadata ptr %p_object, metadata !69, metadata !DIExpression()), !dbg !70
457  %a = getelementptr inbounds %struct.Foo, ptr %s, i32 0, i32 0, !dbg !71
458  store ptr %a, ptr %p_object, align 8, !dbg !70
459  call void @llvm.dbg.declare(metadata ptr %p_data_member, metadata !72, metadata !DIExpression()), !dbg !75
460  store i32 0, ptr %p_data_member, align 8, !dbg !75
461  call void @llvm.dbg.declare(metadata ptr %p_member_func, metadata !76, metadata !DIExpression()), !dbg !78
462  store ptr @"\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z", ptr %p_member_func, align 8, !dbg !78
463  ret void, !dbg !79
464}
465
466; Function Attrs: argmemonly nounwind
467declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1) #2
468
469; Function Attrs: noinline nounwind optnone uwtable
470define internal i32 @"\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z"(ptr %this, i32 %x) #0 align 2 !dbg !80 {
471entry:
472  %x.addr = alloca i32, align 4
473  %this.addr = alloca ptr, align 8
474  store i32 %x, ptr %x.addr, align 4
475  call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !81, metadata !DIExpression()), !dbg !82
476  store ptr %this, ptr %this.addr, align 8
477  call void @llvm.dbg.declare(metadata ptr %this.addr, metadata !83, metadata !DIExpression()), !dbg !85
478  %this1 = load ptr, ptr %this.addr, align 8
479  ret i32 1, !dbg !86
480}
481
482attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
483attributes #1 = { nounwind readnone speculatable }
484attributes #2 = { argmemonly nounwind }
485
486!llvm.dbg.cu = !{!9}
487!llvm.module.flags = !{!17, !18, !19, !20}
488!llvm.ident = !{!21}
489
490!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
491!1 = distinct !DIGlobalVariable(name: "str", scope: !2, file: !3, line: 18, type: !12, isLocal: true, isDefinition: true)
492!2 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXAEIAH@Z", scope: !3, file: !3, line: 16, type: !4, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10)
493!3 = !DIFile(filename: "m.cpp", directory: "C:\5CUsers\5CHui\5Ctmp\5Chui", checksumkind: CSK_MD5, checksum: "a8da0f4dca948db1ef1129c8728a881c")
494!4 = !DISubroutineType(types: !5)
495!5 = !{null, !6}
496!6 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !7)
497!7 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !8, size: 64)
498!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
499!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, globals: !11)
500!10 = !{}
501!11 = !{!0}
502!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 32, elements: !15)
503!13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14)
504!14 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
505!15 = !{!16}
506!16 = !DISubrange(count: 4)
507!17 = !{i32 2, !"CodeView", i32 1}
508!18 = !{i32 2, !"Debug Info Version", i32 3}
509!19 = !{i32 1, !"wchar_size", i32 2}
510!20 = !{i32 7, !"PIC Level", i32 2}
511!21 = !{!"clang version 7.0.0 "}
512!22 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHPEIDH@Z", scope: !3, file: !3, line: 9, type: !23, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10)
513!23 = !DISubroutineType(types: !24)
514!24 = !{!8, !25}
515!25 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !26)
516!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !27, size: 64)
517!27 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !28)
518!28 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !8)
519!29 = !DILocalVariable(name: "arg_crv", arg: 1, scope: !22, file: !3, line: 9, type: !25)
520!30 = !DILocation(line: 9, column: 39, scope: !22)
521!31 = !DILocalVariable(name: "u", scope: !22, file: !3, line: 10, type: !32)
522!32 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "Union", file: !3, line: 3, size: 64, flags: DIFlagTypePassByValue, elements: !33, identifier: ".?ATUnion@@")
523!33 = !{!34, !37, !41}
524!34 = !DIDerivedType(tag: DW_TAG_member, name: "x_member", scope: !32, file: !3, line: 4, baseType: !35, size: 64)
525!35 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !36)
526!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64)
527!37 = !DIDerivedType(tag: DW_TAG_member, name: "y_member", scope: !32, file: !3, line: 5, baseType: !38, size: 64)
528!38 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !39)
529!39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !40, size: 64)
530!40 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)
531!41 = !DIDerivedType(tag: DW_TAG_member, name: "m_volatile", scope: !32, file: !3, line: 6, baseType: !42, size: 64)
532!42 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !35)
533!43 = !DILocation(line: 10, column: 10, scope: !22)
534!44 = !DILocalVariable(name: "p", scope: !22, file: !3, line: 11, type: !45)
535!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !46, size: 64)
536!46 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)
537!47 = !DILocation(line: 11, column: 15, scope: !22)
538!48 = !DILocalVariable(name: "v", scope: !22, file: !3, line: 12, type: !27)
539!49 = !DILocation(line: 12, column: 23, scope: !22)
540!50 = !DILocation(line: 13, column: 4, scope: !22)
541!51 = !DILocalVariable(name: "arg_ref", arg: 1, scope: !2, file: !3, line: 16, type: !6)
542!52 = !DILocation(line: 16, column: 25, scope: !2)
543!53 = !DILocalVariable(name: "x", scope: !2, file: !3, line: 17, type: !46)
544!54 = !DILocation(line: 17, column: 14, scope: !2)
545!55 = !DILocation(line: 19, column: 2, scope: !2)
546!56 = distinct !DISubprogram(name: "h", linkageName: "\01?h@@YAXXZ", scope: !3, file: !3, line: 21, type: !57, isLocal: false, isDefinition: true, scopeLine: 21, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10)
547!57 = !DISubroutineType(types: !58)
548!58 = !{null}
549!59 = !DILocalVariable(name: "s", scope: !56, file: !3, line: 27, type: !60)
550!60 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !56, file: !3, line: 22, size: 32, flags: DIFlagTypePassByValue, elements: !61)
551!61 = !{!62, !63}
552!62 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !60, file: !3, line: 23, baseType: !8, size: 32)
553!63 = !DISubprogram(name: "func", scope: !60, file: !3, line: 24, type: !64, isLocal: false, isDefinition: false, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false)
554!64 = !DISubroutineType(types: !65)
555!65 = !{!8, !66, !8}
556
557; FIXME: Clang emits wrong debug info here because of PR17747. We should
558; regenerate this IR when it is fixed.
559!66 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !67, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
560!67 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !60)
561
562!68 = !DILocation(line: 27, column: 8, scope: !56)
563!69 = !DILocalVariable(name: "p_object", scope: !56, file: !3, line: 29, type: !35)
564!70 = !DILocation(line: 29, column: 20, scope: !56)
565!71 = !DILocation(line: 29, column: 34, scope: !56)
566!72 = !DILocalVariable(name: "p_data_member", scope: !56, file: !3, line: 31, type: !73)
567!73 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !74)
568!74 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !8, size: 32, flags: DIFlagSingleInheritance, extraData: !60)
569!75 = !DILocation(line: 31, column: 27, scope: !56)
570!76 = !DILocalVariable(name: "p_member_func", scope: !56, file: !3, line: 33, type: !77)
571!77 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !64, size: 64, flags: DIFlagSingleInheritance, extraData: !60)
572!78 = !DILocation(line: 33, column: 16, scope: !56)
573!79 = !DILocation(line: 34, column: 2, scope: !56)
574!80 = distinct !DISubprogram(name: "func", linkageName: "\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z", scope: !60, file: !3, line: 24, type: !64, isLocal: true, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !9, declaration: !63, retainedNodes: !10)
575!81 = !DILocalVariable(name: "x", arg: 2, scope: !80, file: !3, line: 24, type: !8)
576!82 = !DILocation(line: 24, column: 19, scope: !80)
577!83 = !DILocalVariable(name: "this", arg: 1, scope: !80, type: !84, flags: DIFlagArtificial | DIFlagObjectPointer)
578!84 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !67, size: 64)
579!85 = !DILocation(line: 0, scope: !80)
580!86 = !DILocation(line: 24, column: 35, scope: !80)
581