Files
clang-p2996/llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
Jeremy Morse 792a6f8119 [RemoveDIs] Remove "try-debuginfo-iterators..." test flags (#130298)
These date back to when the non-intrinsic format of variable locations
was still being tested and was behind a compile-time flag, so not all
builds / bots would correctly run them. The solution at the time, to get
at least some test coverage, was to have tests opt-in to non-intrinsic
debug-info if it was built into LLVM.

Nowadays, non-intrinsic format is the default and has been on for more
than a year, there's no need for this flag to exist.

(I've downgraded the flag from "try" to explicitly requesting
non-intrinsic format in some places, so that we can deal with tests that
are explicitly about non-intrinsic format in their own commit).
2025-03-14 15:50:49 +00:00

53 lines
2.9 KiB
LLVM

; RUN: opt < %s -passes=mem2reg -S | FileCheck %s
define double @testfunc(i32 %i, double %j) nounwind ssp !dbg !1 {
entry:
%i_addr = alloca i32 ; <ptr> [#uses=2]
%j_addr = alloca double ; <ptr> [#uses=2]
%retval = alloca double ; <ptr> [#uses=2]
%0 = alloca double ; <ptr> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.declare(metadata ptr %i_addr, metadata !0, metadata !DIExpression()), !dbg !8
; CHECK: #dbg_value(i32 %i, ![[IVAR:[0-9]*]], {{.*}})
; CHECK: #dbg_value(double %j, ![[JVAR:[0-9]*]], {{.*}})
; CHECK: ![[IVAR]] = !DILocalVariable(name: "i"
; CHECK: ![[JVAR]] = !DILocalVariable(name: "j"
store i32 %i, ptr %i_addr
call void @llvm.dbg.declare(metadata ptr %j_addr, metadata !9, metadata !DIExpression()), !dbg !8
store double %j, ptr %j_addr
%1 = load i32, ptr %i_addr, align 4, !dbg !10 ; <i32> [#uses=1]
%2 = add nsw i32 %1, 1, !dbg !10 ; <i32> [#uses=1]
%3 = sitofp i32 %2 to double, !dbg !10 ; <double> [#uses=1]
%4 = load double, ptr %j_addr, align 8, !dbg !10 ; <double> [#uses=1]
%5 = fadd double %3, %4, !dbg !10 ; <double> [#uses=1]
store double %5, ptr %0, align 8, !dbg !10
%6 = load double, ptr %0, align 8, !dbg !10 ; <double> [#uses=1]
store double %6, ptr %retval, align 8, !dbg !10
br label %return, !dbg !10
return: ; preds = %entry
%retval1 = load double, ptr %retval, !dbg !10 ; <double> [#uses=1]
ret double %retval1, !dbg !10
}
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!llvm.dbg.cu = !{!3}
!llvm.module.flags = !{!14}
!0 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !7)
!1 = distinct !DISubprogram(name: "testfunc", linkageName: "testfunc", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, scopeLine: 2, file: !12, scope: !2, type: !4)
!2 = !DIFile(filename: "testfunc.c", directory: "/tmp")
!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !12, enums: !13, retainedTypes: !13)
!4 = !DISubroutineType(types: !5)
!5 = !{!6, !7, !6}
!6 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DILocation(line: 2, scope: !1)
!9 = !DILocalVariable(name: "j", line: 2, arg: 2, scope: !1, file: !2, type: !6)
!10 = !DILocation(line: 3, scope: !11)
!11 = distinct !DILexicalBlock(line: 2, column: 0, file: !12, scope: !1)
!12 = !DIFile(filename: "testfunc.c", directory: "/tmp")
!13 = !{}
!14 = !{i32 1, !"Debug Info Version", i32 3}