diff options
Diffstat (limited to 'llvm/test/DebugInfo')
-rw-r--r-- | llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll | 10 | ||||
-rw-r--r-- | llvm/test/DebugInfo/X86/shrink-wrap-frame-setup-no-loc.mir | 99 |
2 files changed, 107 insertions, 2 deletions
diff --git a/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll b/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll index e2b6167..c8cc871 100644 --- a/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll +++ b/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll @@ -1,6 +1,10 @@ ; RUN: %llc_dwarf -filetype=obj -O0 < %s | llvm-dwarfdump -debug-info - | FileCheck %s --implicit-check-not "DW_AT_language" -; CHECK: DW_AT_language_name (DW_LNAME_ObjC_plus_plus) +; CHECK: DW_AT_language_name (DW_LNAME_ObjC_plus_plus) +; CHECK: DW_AT_language_name (DW_LNAME_C_plus_plus) +; CHECK: DW_AT_language_version (201100) +; CHECK: DW_AT_language_name (DW_LNAME_Rust) +; CHECK-NOT: DW_AT_language_version @x = global i32 0, align 4, !dbg !0 @@ -9,7 +13,7 @@ define void @_Z4funcv() !dbg !8 { ret void, !dbg !11 } -!llvm.dbg.cu = !{!2} +!llvm.dbg.cu = !{!2, !12, !13} !llvm.module.flags = !{!6, !7} !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) @@ -24,3 +28,5 @@ define void @_Z4funcv() !dbg !8 { !9 = !DISubroutineType(types: !10) !10 = !{null} !11 = !DILocation(line: 2, column: 14, scope: !8) +!12 = distinct !DICompileUnit(sourceLanguageName: DW_LNAME_C_plus_plus, sourceLanguageVersion: 201100, file: !3, producer: "handwritten", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/") +!13 = distinct !DICompileUnit(sourceLanguageName: DW_LNAME_Rust, sourceLanguageVersion: 0, file: !3, producer: "handwritten", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/") 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 +... |