diff options
Diffstat (limited to 'llvm/test/DebugInfo')
-rw-r--r-- | llvm/test/DebugInfo/AArch64/callsite.mir | 68 | ||||
-rw-r--r-- | llvm/test/DebugInfo/COFF/AArch64/codeview-sve.ll | 2 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/shrink-wrap-frame-setup-no-loc.mir | 99 | ||||
-rw-r--r-- | llvm/test/DebugInfo/XCOFF/empty.ll | 4 | ||||
-rw-r--r-- | llvm/test/DebugInfo/XCOFF/explicit-section.ll | 4 | ||||
-rw-r--r-- | llvm/test/DebugInfo/XCOFF/function-sections.ll | 4 |
6 files changed, 174 insertions, 7 deletions
diff --git a/llvm/test/DebugInfo/AArch64/callsite.mir b/llvm/test/DebugInfo/AArch64/callsite.mir new file mode 100644 index 0000000..e3bd764 --- /dev/null +++ b/llvm/test/DebugInfo/AArch64/callsite.mir @@ -0,0 +1,68 @@ +# This test should not crash when generating call-site information. +# It was created to make sure that if isCopyLikeInstr in TargetInstrInfo.h +# returns an undef Dest Reg or Src Reg, we don't try to get a SubReg for it. + +# RUN: llc --mtriple=arm64e-apple-ios -start-before=aarch64-asm-printer %s -filetype=obj -o /dev/null --emit-call-site-info +--- | + %struct.rtyuio = type { i8 } + define noundef i32 @aserty(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 !dbg !23 { + ret i32 0 + } + define void @asdfgh(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2) local_unnamed_addr #0 !dbg !53 { + %4 = alloca ptr + %5 = call ptr @llvm.stackguard() + %6 = alloca %struct.rtyuio + %7 = icmp eq ptr %1, null + br i1 %7, label %10, label %8 + %9 = tail call i8 @polkiokl(ptr noundef %0) #6 + br label %10 + ret void + } + declare i8 @polkiokl(ptr noundef) local_unnamed_addr #2 + !llvm.module.flags = !{!2, !8} + !llvm.dbg.cu = !{!9} + !2 = !{i32 2, !"Debug Info Version", i32 3} + !8 = !{i32 7, !"frame-pointer", i32 1} + !9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11, file: !10, emissionKind: FullDebug, sysroot: "/") + !10 = !DIFile(filename: "a.cpp", directory: "/") + !23 = distinct !DISubprogram(type: !27, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, unit: !9, retainedNodes: !46) + !24 = distinct !DICompositeType(tag: DW_TAG_class_type, identifier: "yshscbshhdvcm") + !27 = !DISubroutineType(types: !28) + !28 = !{} + !30 = !DIDerivedType(tag: DW_TAG_typedef, baseType: !33) + !33 = distinct !DICompositeType(tag: DW_TAG_structure_type, identifier: "tyruwyeuiwiybabd") + !36 = !DISubroutineType(types: !37) + !37 = !{} + !46 = !{} + !47 = !DILocalVariable(scope: !23, type: !48, flags: DIFlagArtificial | DIFlagObjectPointer) + !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64) + !49 = !DILocalVariable(scope: !23, type: !30) + !50 = !DILocation(scope: !23) + !51 = !DILocation(scope: !23) + !53 = distinct !DISubprogram(type: !36, unit: !9, retainedNodes: !54) + !54 = !{} +name: aserty +stack: + - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8, + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } + - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8, + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } +callSites: + - { bb: 0, offset: 9, fwdArgRegs: + - { arg: 2, reg: '$w2' } } +body: | + bb.0 (%ir-block.2): + DBG_VALUE $x0, $noreg, !47, !DIExpression(), debug-location !50 + DBG_VALUE $x1, $noreg, !49, !DIExpression(), debug-location !50 + frame-setup PACIBSP implicit-def $lr, implicit killed $lr, implicit $sp + early-clobber $sp = frame-setup STPXpre $fp, killed $lr, $sp, -2 :: (store (s64) into %stack.1), (store (s64) into %stack.0) + $fp = frame-setup ADDXri $sp, 0, 0 + frame-setup CFI_INSTRUCTION def_cfa $w29, 16 + frame-setup CFI_INSTRUCTION offset $w30, -8 + frame-setup CFI_INSTRUCTION offset $w29, -16 + $x2 = ORRXrs $xzr, undef $noreg, 0, implicit $wzr, debug-location !51 + BL @asdfgh, csr_darwin_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $x0, implicit killed $x1, implicit killed $w2, implicit-def $sp, debug-location !51 +... +name: asdfgh +body: | + bb.2 (%ir-block.10): diff --git a/llvm/test/DebugInfo/COFF/AArch64/codeview-sve.ll b/llvm/test/DebugInfo/COFF/AArch64/codeview-sve.ll index 446a84d..ffdc80a 100644 --- a/llvm/test/DebugInfo/COFF/AArch64/codeview-sve.ll +++ b/llvm/test/DebugInfo/COFF/AArch64/codeview-sve.ll @@ -101,7 +101,7 @@ ; CHECK-NEXT: LocalVariableAddrRange { ; CHECK-NEXT: OffsetStart: .text+0x0 ; CHECK-NEXT: ISectStart: 0x0 -; CHECK-NEXT: Range: 0xBC +; CHECK-NEXT: Range: 0xB8 ; CHECK-NEXT: } ; CHECK-NEXT: } ; CHECK-NEXT: ProcEnd { diff --git a/llvm/test/DebugInfo/X86/shrink-wrap-frame-setup-no-loc.mir b/llvm/test/DebugInfo/X86/shrink-wrap-frame-setup-no-loc.mir new file mode 100644 index 0000000..b97e916 --- /dev/null +++ b/llvm/test/DebugInfo/X86/shrink-wrap-frame-setup-no-loc.mir @@ -0,0 +1,99 @@ +# RUN: %llc_dwarf %s -o - -mtriple=x86_64-unknown-unknown --start-after=livedebugvalues | FileCheck %s + +## Check the line number from the ret above `.LBB0_2` doesn't leak onto the +## frame setup instructions in the `.LBB0_2` block; `pushq %rax` should +## explicitly get set to line zero. + +# CHECK: loop: +# CHECK-NEXT: .Lfunc_begin0: +# CHECK-NEXT: .cfi_startproc +# CHECK-NEXT: # %bb.0: +# CHECK-NEXT: .file 1 "/" "test.c" +# CHECK-NEXT: .loc 1 5 16 prologue_end # test.c:5:16 +# CHECK-NEXT: testq %rax, %rax +# CHECK-NEXT: je .LBB0_2 +# CHECK-NEXT: # %bb.1: +# CHECK-NEXT: .loc 1 5 16 # test.c:5:16 +# CHECK-NEXT: retq +# CHECK-NEXT: .LBB0_2: +# -- Check the .loc below sets the current location to line 0. +# CHECK-NEXT: .loc 1 0 16 is_stmt 0 # test.c:0:16 +# CHECK-NEXT: pushq %rax +# CHECK-NEXT: .cfi_def_cfa_offset 16 +# CHECK-NEXT: addq $8, %rsp +# CHECK-NEXT: .cfi_def_cfa_offset 8 +# CHECK-NEXT: .loc 1 5 16 is_stmt 1 # test.c:5:16 +# CHECK-NEXT: retq + +--- | + source_filename = "reduced.ll" + target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" + target triple = "x86_64-unknown-unknown" + + define void @loop(i64 %i) !dbg !4 { + entry: + %cmp.not = icmp eq i64 %i, 0, !dbg !7 + br i1 %cmp.not, label %for.body, label %for.end + + for.body: ; preds = %entry + %puts10 = tail call i32 null(ptr null) + %inc = add i64 0, 0 + br label %for.end + + for.end: ; preds = %for.body, %entry + ret void + } + + !llvm.dbg.cu = !{!0} + !llvm.module.flags = !{!3} + + !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 22.0.0git", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !2, splitDebugInlining: false, nameTableKind: None) + !1 = !DIFile(filename: "test.c", directory: "/") + !2 = !{} + !3 = !{i32 2, !"Debug Info Version", i32 3} + !4 = distinct !DISubprogram(name: "loop", scope: !1, file: !1, line: 4, type: !5, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2, keyInstructions: true) + !5 = !DISubroutineType(types: !6) + !6 = !{null} + !7 = !DILocation(line: 5, column: 16, scope: !8, atomGroup: 720, atomRank: 2) + !8 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5, column: 9) +... +--- +name: loop +alignment: 16 +tracksRegLiveness: true +noPhis: true +isSSA: false +noVRegs: true +hasFakeUses: false +debugInstrRef: true +tracksDebugUserValues: true +liveins: + - { reg: '$rdi' } +frameInfo: + stackSize: 8 + offsetAdjustment: -8 + maxAlignment: 1 + adjustsStack: true + hasCalls: true + maxCallFrameSize: 0 + isCalleeSavedInfoValid: true +machineFunctionInfo: + amxProgModel: None +body: | + bb.0: + successors: %bb.1(0x30000000), %bb.2(0x50000000) + liveins: $rdi + + TEST64rr undef renamable $rax, undef renamable $rax, implicit-def $eflags, debug-location !7 + JCC_1 %bb.1, 4, implicit $eflags + + bb.2: + RET64 debug-location !7 + + bb.1: + frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp + frame-setup CFI_INSTRUCTION def_cfa_offset 16 + $rsp = frame-destroy ADD64ri32 $rsp, 8, implicit-def dead $eflags + frame-destroy CFI_INSTRUCTION def_cfa_offset 8 + RET64 debug-location !7 +... diff --git a/llvm/test/DebugInfo/XCOFF/empty.ll b/llvm/test/DebugInfo/XCOFF/empty.ll index af2f74f..24655e5 100644 --- a/llvm/test/DebugInfo/XCOFF/empty.ll +++ b/llvm/test/DebugInfo/XCOFF/empty.ll @@ -61,7 +61,7 @@ entry: ; ASM32-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; ASM32-NEXT: .byte 0x00 # Version = 0 ; ASM32-NEXT: .byte 0x09 # Language = CPlusPlus -; ASM32-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; ASM32-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; ASM32-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; ASM32-NEXT: # -HasControlledStorage, -IsTOCless ; ASM32-NEXT: # -IsFloatingPointPresent @@ -264,7 +264,7 @@ entry: ; ASM64-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; ASM64-NEXT: .byte 0x00 # Version = 0 ; ASM64-NEXT: .byte 0x09 # Language = CPlusPlus -; ASM64-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; ASM64-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; ASM64-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; ASM64-NEXT: # -HasControlledStorage, -IsTOCless ; ASM64-NEXT: # -IsFloatingPointPresent diff --git a/llvm/test/DebugInfo/XCOFF/explicit-section.ll b/llvm/test/DebugInfo/XCOFF/explicit-section.ll index 0ae9289..3bcc0f9 100644 --- a/llvm/test/DebugInfo/XCOFF/explicit-section.ll +++ b/llvm/test/DebugInfo/XCOFF/explicit-section.ll @@ -65,7 +65,7 @@ entry: ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; CHECK-NEXT: .byte 0x00 # Version = 0 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus -; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; CHECK-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless ; CHECK-NEXT: # -IsFloatingPointPresent @@ -113,7 +113,7 @@ entry: ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; CHECK-NEXT: .byte 0x00 # Version = 0 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus -; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; CHECK-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless ; CHECK-NEXT: # -IsFloatingPointPresent diff --git a/llvm/test/DebugInfo/XCOFF/function-sections.ll b/llvm/test/DebugInfo/XCOFF/function-sections.ll index 6a86ae6..0b7a03b 100644 --- a/llvm/test/DebugInfo/XCOFF/function-sections.ll +++ b/llvm/test/DebugInfo/XCOFF/function-sections.ll @@ -60,7 +60,7 @@ entry: ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; CHECK-NEXT: .byte 0x00 # Version = 0 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus -; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; CHECK-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless ; CHECK-NEXT: # -IsFloatingPointPresent @@ -95,7 +95,7 @@ entry: ; CHECK-NEXT: .vbyte 4, 0x00000000 # Traceback table begin ; CHECK-NEXT: .byte 0x00 # Version = 0 ; CHECK-NEXT: .byte 0x09 # Language = CPlusPlus -; CHECK-NEXT: .byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue +; CHECK-NEXT: .byte 0x20 # -IsGlobalLinkage, -IsOutOfLineEpilogOrPrologue ; CHECK-NEXT: # +HasTraceBackTableOffset, -IsInternalProcedure ; CHECK-NEXT: # -HasControlledStorage, -IsTOCless ; CHECK-NEXT: # -IsFloatingPointPresent |