1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s 3; RUN: llc < %s | llvm-mc -filetype=obj --triple=i686-windows | llvm-readobj - --codeview | FileCheck %s 4 5; C++ source to regenerate: 6; $ cat t.cpp 7; void usevars(int, ...); 8; void f() { 9; int a[5] = {9, 4, 5, 4, 2}; 10; usevars(a[0], a); 11; } 12; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll 13 14; CHECK: CodeViewTypes [ 15; CHECK: Section: .debug$T (6) 16; CHECK: Magic: 0x4 17; CHECK: ArgList (0x1000) { 18; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 19; CHECK: NumArgs: 0 20; CHECK: Arguments [ 21; CHECK: ] 22; CHECK: } 23; CHECK: Procedure (0x1001) { 24; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 25; CHECK: ReturnType: void (0x3) 26; CHECK: CallingConvention: NearC (0x0) 27; CHECK: FunctionOptions [ (0x0) 28; CHECK: ] 29; CHECK: NumParameters: 0 30; CHECK: ArgListType: () (0x1000) 31; CHECK: } 32; CHECK: FuncId (0x1002) { 33; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 34; CHECK: ParentScope: 0x0 35; CHECK: FunctionType: void () (0x1001) 36; CHECK: Name: f 37; CHECK: } 38; CHECK: Array (0x1003) { 39; CHECK: TypeLeafKind: LF_ARRAY (0x1503) 40; CHECK: ElementType: int (0x74) 41; CHECK: IndexType: unsigned long (0x22) 42; CHECK: SizeOf: 20 43; CHECK: Name: 44; CHECK: } 45; CHECK: ] 46; CHECK: CodeViewDebugInfo [ 47; CHECK: Section: .debug$S (5) 48; CHECK: Magic: 0x4 49; CHECK: Subsection [ 50; CHECK: SubSectionType: Symbols (0xF1) 51; CHECK: {{.*}}Proc{{.*}}Sym { 52; CHECK: PtrParent: 0x0 53; CHECK: PtrEnd: 0x0 54; CHECK: PtrNext: 0x0 55; CHECK: CodeSize: 0x39 56; CHECK: DbgStart: 0x0 57; CHECK: DbgEnd: 0x0 58; CHECK: FunctionType: f (0x1002) 59; CHECK: CodeOffset: ?f@@YAXXZ+0x0 60; CHECK: Segment: 0x0 61; CHECK: Flags [ (0x0) 62; CHECK: ] 63; CHECK: DisplayName: f 64; CHECK: LinkageName: ?f@@YAXXZ 65; CHECK: } 66; CHECK: LocalSym { 67; CHECK: Type: 0x1003 68; CHECK: Flags [ (0x0) 69; CHECK: ] 70; CHECK: VarName: a 71; CHECK: } 72; CHECK: DefRangeFramePointerRelSym { 73; CHECK: Offset: -20 74; CHECK: LocalVariableAddrRange { 75; CHECK: OffsetStart: .text+0x9 76; CHECK: ISectStart: 0x0 77; CHECK: Range: 0x30 78; CHECK: } 79; CHECK: } 80; CHECK: ProcEnd { 81; CHECK: } 82; CHECK: ] 83 84; ModuleID = 't.cpp' 85source_filename = "t.cpp" 86target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" 87target triple = "i686-pc-windows-msvc19.0.23918" 88 89@"\01?a@?1??f@@YAXXZ@3PAHA" = private unnamed_addr constant [5 x i32] [i32 9, i32 4, i32 5, i32 4, i32 2], align 4 90 91define void @"\01?f@@YAXXZ"() #0 !dbg !6 { 92entry: 93 %a = alloca [5 x i32], align 4 94 call void @llvm.dbg.declare(metadata [5 x i32]* %a, metadata !9, metadata !14), !dbg !15 95 %0 = bitcast [5 x i32]* %a to i8*, !dbg !15 96 call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 bitcast ([5 x i32]* @"\01?a@?1??f@@YAXXZ@3PAHA" to i8*), i32 20, i1 false), !dbg !15 97 %arraydecay = getelementptr inbounds [5 x i32], [5 x i32]* %a, i32 0, i32 0, !dbg !16 98 %arrayidx = getelementptr inbounds [5 x i32], [5 x i32]* %a, i32 0, i32 0, !dbg !17 99 %1 = load i32, i32* %arrayidx, align 4, !dbg !17 100 call void (i32, ...) @"\01?usevars@@YAXHZZ"(i32 %1, i32* %arraydecay), !dbg !18 101 ret void, !dbg !19 102} 103 104; Function Attrs: nounwind readnone 105declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 106 107; Function Attrs: argmemonly nounwind 108declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) #2 109 110declare void @"\01?usevars@@YAXHZZ"(i32, ...) #3 111 112attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 113attributes #1 = { nounwind readnone } 114attributes #2 = { argmemonly nounwind } 115attributes #3 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 116 117!llvm.dbg.cu = !{!0} 118!llvm.module.flags = !{!3, !4} 119!llvm.ident = !{!5} 120 121!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 122!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cllvm\5Ctest\5CDebugInfo\5CCOFF") 123!2 = !{} 124!3 = !{i32 2, !"CodeView", i32 1} 125!4 = !{i32 2, !"Debug Info Version", i32 3} 126!5 = !{!"clang version 3.9.0 "} 127!6 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 128!7 = !DISubroutineType(types: !8) 129!8 = !{null} 130!9 = !DILocalVariable(name: "a", scope: !6, file: !1, line: 3, type: !10) 131!10 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 160, align: 32, elements: !12) 132!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 133!12 = !{!13} 134!13 = !DISubrange(count: 5) 135!14 = !DIExpression() 136!15 = !DILocation(line: 3, column: 7, scope: !6) 137!16 = !DILocation(line: 4, column: 17, scope: !6) 138!17 = !DILocation(line: 4, column: 11, scope: !6) 139!18 = !DILocation(line: 4, column: 3, scope: !6) 140!19 = !DILocation(line: 5, column: 1, scope: !6) 141