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; C++ source to regenerate: 5; struct A { 6; int NoRefQual(); 7; 8; int RefQual() &; 9; int RefQual() &&; 10; 11; int LValueRef() &; 12; 13; int RValueRef() &&; 14; }; 15; 16; void foo() { 17; A *GenericPtr = nullptr; 18; A a; 19; } 20 21 22; ModuleID = 'foo.cpp' 23source_filename = "foo.cpp" 24target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 25target triple = "x86_64-pc-windows-msvc19.15.26732" 26 27%struct.A = type { i8 } 28 29; Function Attrs: noinline nounwind optnone uwtable 30define dso_local void @"?foo@@YAXXZ"() #0 !dbg !10 { 31entry: 32 %GenericPtr = alloca %struct.A*, align 8 33 %a = alloca %struct.A, align 1 34 call void @llvm.dbg.declare(metadata %struct.A** %GenericPtr, metadata !13, metadata !DIExpression()), !dbg !28 35 store %struct.A* null, %struct.A** %GenericPtr, align 8, !dbg !28 36 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !29, metadata !DIExpression()), !dbg !30 37 ret void, !dbg !31 38} 39 40; Function Attrs: nounwind readnone speculatable 41declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 42 43attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" } 44attributes #1 = { nounwind readnone speculatable } 45 46!llvm.dbg.cu = !{!0} 47!llvm.linker.options = !{!3, !4} 48!llvm.module.flags = !{!5, !6, !7, !8} 49!llvm.ident = !{!9} 50 51!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None) 52!1 = !DIFile(filename: "foo.cpp", directory: "D:\5C\5Csrc\5C\5Cllvmbuild\5C\5Cninja-x64", checksumkind: CSK_MD5, checksum: "d1b6ae9dc9ab85ca0a41c8b8c79a0b6a") 53!2 = !{} 54!3 = !{!"/DEFAULTLIB:libcmt.lib"} 55!4 = !{!"/DEFAULTLIB:oldnames.lib"} 56!5 = !{i32 2, !"CodeView", i32 1} 57!6 = !{i32 2, !"Debug Info Version", i32 3} 58!7 = !{i32 1, !"wchar_size", i32 2} 59!8 = !{i32 7, !"PIC Level", i32 2} 60!9 = !{!"clang version 8.0.0 "} 61!10 = distinct !DISubprogram(name: "foo", linkageName: "?foo@@YAXXZ", scope: !1, file: !1, line: 12, type: !11, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 62!11 = !DISubroutineType(types: !12) 63!12 = !{null} 64!13 = !DILocalVariable(name: "GenericPtr", scope: !10, file: !1, line: 13, type: !14) 65!14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64) 66!15 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !16, identifier: ".?AUA@@") 67!16 = !{!17, !22, !24, !26, !27} 68!17 = !DISubprogram(name: "NoRefQual", linkageName: "?NoRefQual@A@@QEAAHXZ", scope: !15, file: !1, line: 2, type: !18, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false) 69!18 = !DISubroutineType(types: !19) 70!19 = !{!20, !21} 71!20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 72!21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 73!22 = !DISubprogram(name: "RefQual", linkageName: "?RefQual@A@@QEGAAHXZ", scope: !15, file: !1, line: 4, type: !23, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false) 74!23 = !DISubroutineType(flags: DIFlagLValueReference, types: !19) 75!24 = !DISubprogram(name: "RefQual", linkageName: "?RefQual@A@@QEHAAHXZ", scope: !15, file: !1, line: 5, type: !25, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped | DIFlagRValueReference, isOptimized: false) 76!25 = !DISubroutineType(flags: DIFlagRValueReference, types: !19) 77!26 = !DISubprogram(name: "LValueRef", linkageName: "?LValueRef@A@@QEGAAHXZ", scope: !15, file: !1, line: 7, type: !23, isLocal: false, isDefinition: false, scopeLine: 7, flags: DIFlagPrototyped | DIFlagLValueReference, isOptimized: false) 78!27 = !DISubprogram(name: "RValueRef", linkageName: "?RValueRef@A@@QEHAAHXZ", scope: !15, file: !1, line: 9, type: !25, isLocal: false, isDefinition: false, scopeLine: 9, flags: DIFlagPrototyped | DIFlagRValueReference, isOptimized: false) 79!28 = !DILocation(line: 13, scope: !10) 80!29 = !DILocalVariable(name: "a", scope: !10, file: !1, line: 14, type: !15) 81!30 = !DILocation(line: 14, scope: !10) 82!31 = !DILocation(line: 15, scope: !10) 83 84 85 86 87; CHECK: CodeViewTypes [ 88; CHECK: Section: .debug$T (7) 89; CHECK: Magic: 0x4 90; CHECK: Pointer (0x1005) { 91; CHECK: TypeLeafKind: LF_POINTER (0x1002) 92; CHECK: PointeeType: A (0x1003) 93; CHECK: PtrType: Near64 (0xC) 94; CHECK: PtrMode: Pointer (0x0) 95; CHECK: IsFlat: 0 96; CHECK: IsConst: 1 97; CHECK: IsVolatile: 0 98; CHECK: IsUnaligned: 0 99; CHECK: IsRestrict: 0 100; CHECK: IsThisPtr&: 0 101; CHECK: IsThisPtr&&: 0 102; CHECK: SizeOf: 8 103; CHECK: } 104; CHECK: MemberFunction (0x1006) { 105; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009) 106; CHECK: ReturnType: int (0x74) 107; CHECK: ClassType: A (0x1003) 108; CHECK: ThisType: A* const (0x1005) 109; CHECK: CallingConvention: NearC (0x0) 110; CHECK: FunctionOptions [ (0x0) 111; CHECK: ] 112; CHECK: NumParameters: 0 113; CHECK: ArgListType: () (0x1000) 114; CHECK: ThisAdjustment: 0 115; CHECK: } 116; CHECK: Pointer (0x1007) { 117; CHECK: TypeLeafKind: LF_POINTER (0x1002) 118; CHECK: PointeeType: A (0x1003) 119; CHECK: PtrType: Near64 (0xC) 120; CHECK: PtrMode: Pointer (0x0) 121; CHECK: IsFlat: 0 122; CHECK: IsConst: 1 123; CHECK: IsVolatile: 0 124; CHECK: IsUnaligned: 0 125; CHECK: IsRestrict: 0 126; CHECK: IsThisPtr&: 1 127; CHECK: IsThisPtr&&: 0 128; CHECK: SizeOf: 136 129; CHECK: } 130; CHECK: MemberFunction (0x1008) { 131; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009) 132; CHECK: ReturnType: int (0x74) 133; CHECK: ClassType: A (0x1003) 134; CHECK: ThisType: A* const (0x1007) 135; CHECK: CallingConvention: NearC (0x0) 136; CHECK: FunctionOptions [ (0x0) 137; CHECK: ] 138; CHECK: NumParameters: 0 139; CHECK: ArgListType: () (0x1000) 140; CHECK: ThisAdjustment: 0 141; CHECK: } 142; CHECK: Pointer (0x1009) { 143; CHECK: TypeLeafKind: LF_POINTER (0x1002) 144; CHECK: PointeeType: A (0x1003) 145; CHECK: PtrType: Near64 (0xC) 146; CHECK: PtrMode: Pointer (0x0) 147; CHECK: IsFlat: 0 148; CHECK: IsConst: 1 149; CHECK: IsVolatile: 0 150; CHECK: IsUnaligned: 0 151; CHECK: IsRestrict: 0 152; CHECK: IsThisPtr&: 0 153; CHECK: IsThisPtr&&: 1 154; CHECK: SizeOf: 8 155; CHECK: } 156; CHECK: MemberFunction (0x100A) { 157; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009) 158; CHECK: ReturnType: int (0x74) 159; CHECK: ClassType: A (0x1003) 160; CHECK: ThisType: A* const (0x1009) 161; CHECK: CallingConvention: NearC (0x0) 162; CHECK: FunctionOptions [ (0x0) 163; CHECK: ] 164; CHECK: NumParameters: 0 165; CHECK: ArgListType: () (0x1000) 166; CHECK: ThisAdjustment: 0 167; CHECK: } 168; CHECK: MethodOverloadList (0x100B) { 169; CHECK: TypeLeafKind: LF_METHODLIST (0x1206) 170; CHECK: Method [ 171; CHECK: AccessSpecifier: Public (0x3) 172; CHECK: Type: int A::() (0x1008) 173; CHECK: ] 174; CHECK: Method [ 175; CHECK: AccessSpecifier: Public (0x3) 176; CHECK: Type: int A::() (0x100A) 177; CHECK: ] 178; CHECK: } 179; CHECK: FieldList (0x100C) { 180; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 181; CHECK: OneMethod { 182; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511) 183; CHECK: AccessSpecifier: Public (0x3) 184; CHECK: Type: int A::() (0x1006) 185; CHECK: Name: NoRefQual 186; CHECK: } 187; CHECK: OverloadedMethod { 188; CHECK: TypeLeafKind: LF_METHOD (0x150F) 189; CHECK: MethodCount: 0x2 190; CHECK: MethodListIndex: 0x100B 191; CHECK: Name: RefQual 192; CHECK: } 193; CHECK: OneMethod { 194; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511) 195; CHECK: AccessSpecifier: Public (0x3) 196; CHECK: Type: int A::() (0x1008) 197; CHECK: Name: LValueRef 198; CHECK: } 199; CHECK: OneMethod { 200; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511) 201; CHECK: AccessSpecifier: Public (0x3) 202; CHECK: Type: int A::() (0x100A) 203; CHECK: Name: RValueRef 204; CHECK: } 205; CHECK: } 206; CHECK: ] 207