1 ; RUN: llc -mtriple=aarch64-windows -filetype=obj -o - %s | \
2 ; RUN: llvm-readobj --codeview - | FileCheck %s --check-prefixes=CHECK,CHECK-STDOUT
3 ; RUN: llc -mtriple=aarch64-windows -filetype=obj -o %t.o %s
4 ; RUN: llvm-readobj --codeview %t.o | FileCheck %s --check-prefixes=CHECK,CHECK-FILE
7 source_filename = "a.c"
8 target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
9 target triple = "aarch64--windows-msvc18.0.0"
11 ; Function Attrs: noinline nounwind optnone
12 define i32 @main() #0 !dbg !7 {
14 %retval = alloca i32, align 4
15 store i32 0, i32* %retval, align 4
19 attributes #0 = { noinline nounwind optnone "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"="generic" "target-features"="+neon" "unsafe-fp-math"="false" "use-soft-float"="false" }
22 !llvm.module.flags = !{!3, !4, !5}
25 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
26 !1 = !DIFile(filename: "a.c", directory: "/", checksumkind: CSK_MD5, checksum: "12345678901234567890123456789012")
28 !3 = !{i32 2, !"CodeView", i32 1}
29 !4 = !{i32 2, !"Debug Info Version", i32 3}
30 !5 = !{i32 1, !"wchar_size", i32 2}
32 !7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2)
33 !8 = !DISubroutineType(types: !9)
35 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
36 !11 = !DILocation(line: 2, column: 3, scope: !7)
38 ; CHECK: Format: COFF-ARM64
39 ; CHECK: Arch: aarch64
40 ; CHECK: AddressSize: 64bit
41 ; CHECK: CodeViewTypes [
42 ; CHECK: Section: .debug$T (5)
44 ; CHECK: ArgList (0x1000) {
45 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
50 ; CHECK: Procedure (0x1001) {
51 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
52 ; CHECK: ReturnType: int (0x74)
53 ; CHECK: CallingConvention: NearC (0x0)
54 ; CHECK: FunctionOptions [ (0x0)
56 ; CHECK: NumParameters: 0
57 ; CHECK: ArgListType: () (0x1000)
59 ; CHECK: FuncId (0x1002) {
60 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
61 ; CHECK: ParentScope: 0x0
62 ; CHECK: FunctionType: int () (0x1001)
66 ; CHECK: CodeViewDebugInfo [
67 ; CHECK: Section: .debug$S (4)
70 ; CHECK: SubSectionType: Symbols (0xF1)
72 ; CHECK: Kind: S_OBJNAME (0x1101)
73 ; CHECK: Signature: 0x0
74 ; CHECK-STDOUT: ObjectName: {{$}}
75 ; CHECK-FILE: ObjectName: {{.*}}.o
77 ; CHECK: Compile3Sym {
78 ; CHECK: Kind: S_COMPILE3 (0x113C)
79 ; CHECK: Language: C (0x0)
80 ; CHECK: Flags [ (0x4000
81 ; CHECK: HotPatch (0x4000)
86 ; CHECK: SubSectionType: Symbols (0xF1)
87 ; CHECK: GlobalProcIdSym {
88 ; CHECK: Kind: S_GPROC32_ID (0x1147)
89 ; CHECK: PtrParent: 0x0
92 ; CHECK: CodeSize: 0x14
93 ; CHECK: DbgStart: 0x0
95 ; CHECK: FunctionType: main (0x1002)
96 ; CHECK: CodeOffset: main+0x0
98 ; CHECK: Flags [ (0x0)
100 ; CHECK: DisplayName: main
101 ; CHECK: LinkageName: main
104 ; CHECK: Kind: S_PROC_ID_END (0x114F)
107 ; CHECK: Subsection [
108 ; CHECK: SubSectionType: Lines (0xF2)
109 ; CHECK: LinkageName: main
111 ; CHECK: Subsection [
112 ; CHECK: SubSectionType: FileChecksums (0xF4)
113 ; CHECK: FileChecksum {
114 ; CHECK: ChecksumSize: 0x10
115 ; CHECK: ChecksumKind: MD5 (0x1)
116 ; CHECK: ChecksumBytes: (12 34 56 78 90 12 34 56 78 90 12 34 56 78 90 12)
119 ; CHECK: Subsection [
120 ; CHECK: SubSectionType: StringTable (0xF3)
122 ; CHECK: FunctionLineTable [
123 ; CHECK: LinkageName: main
125 ; CHECK: CodeSize: 0x14
126 ; CHECK: FilenameSegment [
128 ; CHECK: LineNumberStart: 1
129 ; CHECK: LineNumberEndDelta: 0
130 ; CHECK: IsStatement: No
135 ; CHECK: LineNumberStart: 2
136 ; CHECK: LineNumberEndDelta: 0
137 ; CHECK: IsStatement: No