brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 9cc25d8 Raw
70 lines · plain
1# RUN: llc -mtriple=x86_64 -run-pass none -o - %s | FileCheck %s2# This test ensures that the MIR parser parses the stack object's debug info3# correctly.4--- |5  declare void @llvm.dbg.declare(metadata, metadata, metadata) #06 7  define void @foo() #1 {8  entry:9    %x.i = alloca i8, align 110    %y.i = alloca [256 x i8], align 1611    %0 = bitcast ptr %y.i to ptr12    br label %for.body13 14  for.body:15    %1 = bitcast ptr %y.i to ptr16    call void @llvm.lifetime.end(i64 -1, ptr %1) #317    call void @llvm.lifetime.start(i64 -1, ptr %0) #318    call void @llvm.dbg.declare(metadata ptr %0, metadata !4, metadata !DIExpression()) #3, !dbg !719    br label %for.body20  }21 22  declare void @llvm.lifetime.start(i64, ptr nocapture) #223 24  declare void @llvm.lifetime.end(i64, ptr nocapture) #225 26  attributes #0 = { nounwind readnone }27  attributes #1 = { nounwind ssp uwtable }28  attributes #2 = { nounwind argmemonly }29  attributes #3 = { nounwind }30 31  !llvm.dbg.cu = !{!0}32  !llvm.module.flags = !{!3}33 34  !0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2)35  !1 = !DIFile(filename: "t.c", directory: "")36  !2 = !{}37  !3 = !{i32 1, !"Debug Info Version", i32 3}38  !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !8)39  !5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)40  !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)41  !7 = !DILocation(line: 0, scope: !5)42  !8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 2048, align: 8, elements: !9)43  !9 = !{!10}44  !10 = !DISubrange(count: 256)45...46---47name:            foo48tracksRegLiveness: true49frameInfo:50  maxAlignment:    1651# CHECK-LABEL: foo52# CHECK: stack:53# CHECK:  - { id: 0, name: y.i, type: default, offset: 0, size: 256, alignment: 16,54# CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,55# CHECK-NEXT: debug-info-variable: '!4', debug-info-expression: '!DIExpression()',56# CHECK-NEXT: debug-info-location: '!10' }57stack:58  - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16,59      debug-info-variable: '!4', debug-info-expression: '!DIExpression()',60      debug-info-location: '!7' }61body: |62  bb.0.entry:63    successors: %bb.1.for.body64  bb.1.for.body:65    successors: %bb.1.for.body66 67    DBG_VALUE %stack.0.y.i, 0, !4, !DIExpression(), debug-location !768    JMP_1 %bb.1.for.body69...70