brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 5b2b6cb Raw
60 lines · plain
1; RUN: opt %s -passes='sroa,verify' -S -o - | FileCheck %s2 3; ModuleID = 'test.c'4; Test that SROA updates the debug info correctly if an alloca was rewritten but5; not partitioned into multiple allocas.6;7; CHECK: #dbg_value(float %s.coerce, ![[VAR:[0-9]+]], !DIExpression(),8; CHECK: ![[VAR]] = !DILocalVariable(name: "s",{{.*}} line: 3,9 10;11; struct S { float f; };12;13; float foo(struct S s) {14;   return s.f;15; }16target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"17target triple = "x86_64-apple-macosx10.10.0"18 19%struct.S = type { float }20 21; Function Attrs: nounwind ssp uwtable22define float @foo(float %s.coerce) #0 !dbg !4 {23entry:24  %s = alloca %struct.S, align 425  store float %s.coerce, ptr %s, align 126  call void @llvm.dbg.declare(metadata ptr %s, metadata !16, metadata !17), !dbg !1827  %0 = load float, ptr %s, align 4, !dbg !1928  ret float %0, !dbg !1929}30 31; Function Attrs: nounwind readnone32declare void @llvm.dbg.declare(metadata, metadata, metadata) #133 34attributes #0 = { nounwind ssp uwtable }35attributes #1 = { nounwind readnone }36 37!llvm.dbg.cu = !{!0}38!llvm.module.flags = !{!12, !13, !14}39!llvm.ident = !{!15}40 41!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)42!1 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug")43!2 = !{}44!4 = distinct !DISubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, retainedNodes: !2)45!5 = !DIFile(filename: "test.c", directory: "/Volumes/Data/llvm/_build.ninja.debug")46!6 = !DISubroutineType(types: !7)47!7 = !{!8, !9}48!8 = !DIBasicType(tag: DW_TAG_base_type, name: "float", size: 32, align: 32, encoding: DW_ATE_float)49!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", line: 1, size: 32, align: 32, file: !1, elements: !10)50!10 = !{!11}51!11 = !DIDerivedType(tag: DW_TAG_member, name: "f", line: 1, size: 32, align: 32, file: !1, scope: !9, baseType: !8)52!12 = !{i32 2, !"Dwarf Version", i32 2}53!13 = !{i32 2, !"Debug Info Version", i32 3}54!14 = !{i32 1, !"PIC Level", i32 2}55!15 = !{!"clang version 3.6.0 "}56!16 = !DILocalVariable(name: "s", line: 3, arg: 1, scope: !4, file: !5, type: !9)57!17 = !DIExpression()58!18 = !DILocation(line: 3, column: 20, scope: !4)59!19 = !DILocation(line: 4, column: 2, scope: !4)60