xref: /llvm-project/llvm/test/DebugInfo/COFF/AArch64/codeview-h-register.mir (revision 49510c50200cf58c9f2dedf4e4ab36a16503878e)
1# This test checks that we have a mapping between the H register chosen by codegen
2# and the codeview number for that register.
3#
4# RUN: llc %s -mtriple=arm64-windows -filetype=obj -o %t --start-after=unpack-mi-bundles
5# RUN: llvm-readobj --codeview %t | FileCheck %s --check-prefix=OBJ
6#
7# OBJ: LocalSym {
8# OBJ:   Kind: S_LOCAL (0x113E)
9# OBJ:   Type: __half (0x46)
10# OBJ:   Flags [ (0x1)
11# OBJ:     IsParameter (0x1)
12# OBJ:   ]
13# OBJ:   VarName: x
14# OBJ: }
15# OBJ: DefRangeRegisterSym {
16# OBJ:   Kind: S_DEFRANGE_REGISTER (0x1141)
17# OBJ:   Register: ARM64_H0 (0x10E)
18# OBJ:   MayHaveNoName: 0
19# OBJ:   LocalVariableAddrRange {
20# OBJ:     OffsetStart: .text+0x0
21# OBJ:     ISectStart: 0x0
22# OBJ:     Range: 0x4
23# OBJ:   }
24# OBJ: }
25#
26--- |
27  define internal fastcc i1 @test.fn(half %0) !dbg !4 {
28  Entry:
29    call void @llvm.dbg.value(metadata half %0, metadata !11, metadata !DIExpression()), !dbg !13
30    %1 = fcmp une half 0xH0000, %0, !dbg !14
31    ret i1 %1
32  }
33
34  ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
35  declare void @llvm.dbg.value(metadata, metadata, metadata) #0
36
37  attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
38
39  !llvm.module.flags = !{!0, !1}
40  !llvm.dbg.cu = !{!2}
41
42  !0 = !{i32 2, !"Debug Info Version", i32 3}
43  !1 = !{i32 2, !"CodeView", i32 1}
44  !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
45  !3 = !DIFile(filename: "test", directory: ".")
46  !4 = distinct !DISubprogram(name: "fn", linkageName: "test.fn", scope: !5, file: !5, line: 32, type: !6, scopeLine: 32, flags: DIFlagStaticMember, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !2, retainedNodes: !10)
47  !5 = !DIFile(filename: "test.o", directory: ".")
48  !6 = !DISubroutineType(types: !7)
49  !7 = !{!8, !9}
50  !8 = !DIBasicType(name: "bool", size: 1, encoding: DW_ATE_boolean)
51  !9 = !DIBasicType(name: "f16", size: 16, encoding: DW_ATE_float)
52  !10 = !{!11}
53  !11 = !DILocalVariable(name: "x", arg: 1, scope: !12, file: !5, line: 32, type: !9)
54  !12 = distinct !DILexicalBlock(scope: !4, file: !5, line: 32, column: 1)
55  !13 = !DILocation(line: 32, column: 31, scope: !12)
56  !14 = !DILocation(line: 33, column: 5, scope: !15)
57  !15 = distinct !DILexicalBlock(scope: !12, file: !5)
58...
59---
60name: test.fn
61body: |
62  bb.0:
63  liveins: $h0
64  DBG_VALUE $h0, $noreg, !11, !DIExpression(), debug-location !13
65  renamable $s0 = nofpexcept FCVTSHr killed renamable $h0, implicit $fpcr, debug-location !14
66  DBG_VALUE $h0, $noreg, !11, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location !13
67  nofpexcept FCMPSri killed renamable $s0, implicit-def $nzcv, implicit $fpcr, debug-location !14
68  renamable $w0 = CSINCWr $wzr, $wzr, 0, implicit killed $nzcv, debug-location !14
69  RET undef $lr, implicit killed $w0
70...
71