57 lines · plain
1; RUN: opt -passes='sroa' -S -o - %s | FileCheck %s2target datalayout = "e-m:o-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"3target triple = "thumbv7-apple-unknown-macho"4 5; generated from (-triple thumbv7-apple-unknown-macho):6; void f(_Complex double c) { c = 0; }7 8; Function Attrs: nounwind9define arm_aapcscc void @f([2 x i64] %c.coerce) #0 !dbg !4 {10entry:11 %c = alloca { double, double }, align 812 store [2 x i64] %c.coerce, ptr %c, align 813 call void @llvm.dbg.declare(metadata ptr %c, metadata !14, metadata !15), !dbg !1614 %c.realp = getelementptr inbounds { double, double }, ptr %c, i32 0, i32 0, !dbg !1715 %c.imagp = getelementptr inbounds { double, double }, ptr %c, i32 0, i32 1, !dbg !1716 store double 0.000000e+00, ptr %c.realp, align 8, !dbg !1717 ; SROA will split the complex double into two double values.18 ; Test that debug info for both values survives:19 ; CHECK: #dbg_value(double 0.000000e+00,20 ; CHECK-SAME: ![[C:[^,]*]],21 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 0, 64),22 store double 0.000000e+00, ptr %c.imagp, align 8, !dbg !1723 ; CHECK: #dbg_value(double 0.000000e+00,24 ; CHECK-SAME: ![[C]],25 ; CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64),26 ret void, !dbg !1827}28 29; Function Attrs: nounwind readnone30declare void @llvm.dbg.declare(metadata, metadata, metadata) #131 32attributes #0 = { nounwind }33attributes #1 = { nounwind readnone }34 35!llvm.dbg.cu = !{!0}36!llvm.module.flags = !{!9, !10, !11, !12}37!llvm.ident = !{!13}38 39!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)40!1 = !DIFile(filename: "<stdin>", directory: "/")41!2 = !{}42!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)43!5 = !DIFile(filename: "test.c", directory: "/")44!6 = !DISubroutineType(types: !7)45!7 = !{null, !8}46!8 = !DIBasicType(name: "complex", size: 128, align: 64, encoding: DW_ATE_complex_float)47!9 = !{i32 2, !"Dwarf Version", i32 2}48!10 = !{i32 2, !"Debug Info Version", i32 3}49!11 = !{i32 1, !"wchar_size", i32 4}50!12 = !{i32 1, !"min_enum_size", i32 4}51!13 = !{!"clang version 3.9.0 (trunk 259998) (llvm/trunk 259999)"}52!14 = !DILocalVariable(name: "c", arg: 1, scope: !4, file: !5, line: 1, type: !8)53!15 = !DIExpression()54!16 = !DILocation(line: 1, column: 24, scope: !4)55!17 = !DILocation(line: 1, column: 31, scope: !4)56!18 = !DILocation(line: 1, column: 36, scope: !4)57