Files
clang-p2996/llvm/test/DebugInfo/ARM/sroa-complex.ll
Stephen Tozer 094572701d [RemoveDIs] Print IR with debug records by default (#91724)
This patch makes the final major change of the RemoveDIs project, changing the
default IR output from debug intrinsics to debug records. This is expected to
break a large number of tests: every single one that tests for uses or
declarations of debug intrinsics and does not explicitly disable writing
records. 

If this patch has broken your downstream tests (or upstream tests on a
configuration I wasn't able to run):
1. If you need to immediately unblock a build, pass
`--write-experimental-debuginfo=false` to LLVM's option processing for all
failing tests (remember to use `-mllvm` for clang/flang to forward arguments to
LLVM).
2. For most test failures, the changes are trivial and mechanical, enough that
they can be done by script; see the migration guide for a guide on how to do
this: https://llvm.org/docs/RemoveDIsDebugInfo.html#test-updates
3. If any tests fail for reasons other than FileCheck check lines that need
updating, such as assertion failures, that is most likely a real bug with this
patch and should be reported as such.

For more information, see the recent PSA:
https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578
2024-06-14 15:07:27 +01:00

58 lines
2.7 KiB
LLVM

; RUN: opt -passes='sroa' -S -o - %s | FileCheck %s
; RUN: opt --try-experimental-debuginfo-iterators -passes='sroa' -S -o - %s | FileCheck %s
target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7-apple-unknown-macho"
; generated from (-triple thumbv7-apple-unknown-macho):
; void f(_Complex double c) { c = 0; }
; Function Attrs: nounwind
define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 {
entry:
%c = alloca { double, double }, align 8
store [2 x i64] %c.coerce, ptr %c, align 8
call void @llvm.dbg.declare(metadata ptr %c, metadata !14, metadata !15), !dbg !16
%c.realp = getelementptr inbounds { double, double }, ptr %c, i32 0, i32 0, !dbg !17
%c.imagp = getelementptr inbounds { double, double }, ptr %c, i32 0, i32 1, !dbg !17
store double 0.000000e+00, ptr %c.realp, align 8, !dbg !17
; SROA will split the complex double into two double values.
; Test that debug info for both values survives:
; CHECK: #dbg_value(double 0.000000e+00,
; CHECK-SAME: ![[C:[^,]*]],
; CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 0, 64),
store double 0.000000e+00, ptr %c.imagp, align 8, !dbg !17
; CHECK: #dbg_value(double 0.000000e+00,
; CHECK-SAME: ![[C]],
; CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64),
ret void, !dbg !18
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
attributes #0 = { nounwind }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!9, !10, !11, !12}
!llvm.ident = !{!13}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "<stdin>", directory: "/")
!2 = !{}
!4 = distinct !DISubprogram(name: "f", scope: !5, file: !5, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!5 = !DIFile(filename: "test.c", directory: "/")
!6 = !DISubroutineType(types: !7)
!7 = !{null, !8}
!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float)
!9 = !{i32 2, !"Dwarf Version", i32 2}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !{i32 1, !"wchar_size", i32 4}
!12 = !{i32 1, !"min_enum_size", i32 4}
!13 = !{!"clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)"}
!14 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8)
!15 = !DIExpression()
!16 = !DILocation(line: 1, column: 24, scope: !4)
!17 = !DILocation(line: 1, column: 31, scope: !4)
!18 = !DILocation(line: 1, column: 36, scope: !4)