Adrian Prantl | 25a09dd | 2017-11-07 00:45:34 +0000 | [diff] [blame^] | 1 | ; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s |
| 2 | ; CHECK: file format Mach-O arm |
| 3 | ; ModuleID = 'test.ll' |
| 4 | source_filename = "test.i" |
| 5 | target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" |
| 6 | target triple = "thumbv7s-apple-ios5.0.0" |
| 7 | |
| 8 | %struct.vm_object = type { i64 } |
| 9 | |
| 10 | ; Function Attrs: nounwind ssp |
| 11 | define void @f(%struct.vm_object* %object, i64* nocapture readonly %start) local_unnamed_addr #0 !dbg !11 { |
| 12 | entry: |
| 13 | tail call void @llvm.dbg.value(metadata %struct.vm_object* %object, metadata !21, metadata !DIExpression()), !dbg !27 |
| 14 | tail call void @llvm.dbg.value(metadata i64* %start, metadata !22, metadata !DIExpression()), !dbg !28 |
| 15 | tail call void @llvm.dbg.value(metadata i64 %0, metadata !25, metadata !DIExpression()), !dbg !29 |
| 16 | tail call void @llvm.dbg.value(metadata i64 %0, metadata !26, metadata !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value)), !dbg !30 |
| 17 | ; This debug value cannot safely be split into two 32-bit pieces. |
| 18 | ; CHECK-NOT: DW_AT_name(offset) |
| 19 | tail call void @llvm.dbg.value(metadata i32 undef, metadata !23, metadata !DIExpression()), !dbg !31 |
| 20 | br i1 undef, label %for.end, label %for.body.lr.ph, !dbg !31 |
| 21 | |
| 22 | for.body.lr.ph: ; preds = %entry |
| 23 | %0 = load i64, i64* %start, align 4, !dbg !33 |
| 24 | br label %for.body, !dbg !31 |
| 25 | |
| 26 | for.body: ; preds = %for.body, %for.body.lr.ph |
| 27 | %offset.010.in = phi i64 [ %0, %for.body.lr.ph ], [ %offset.010, %for.body ] |
| 28 | %head_size.09 = phi i32 [ undef, %for.body.lr.ph ], [ %sub2, %for.body ] |
| 29 | %offset.010 = add i64 %offset.010.in, -4096 |
| 30 | tail call void @llvm.dbg.value(metadata i32 %head_size.09, metadata !23, metadata !DIExpression()), !dbg !30 |
| 31 | %call = tail call i32 bitcast (i32 (...)* @use to i32 (i64, %struct.vm_object*)*)(i64 %offset.010, %struct.vm_object* %object) #2, !dbg !34 |
| 32 | %sub2 = add i32 %head_size.09, -4096, !dbg !37 |
| 33 | tail call void @llvm.dbg.value(metadata i64 %offset.010, metadata !26, metadata !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value)), !dbg !29 |
| 34 | tail call void @llvm.dbg.value(metadata i32 %sub2, metadata !23, metadata !DIExpression()), !dbg !30 |
| 35 | %tobool = icmp eq i32 %sub2, 0, !dbg !31 |
| 36 | br i1 %tobool, label %for.end, label %for.body, !dbg !31, !llvm.loop !38 |
| 37 | |
| 38 | for.end: ; preds = %for.body, %entry |
| 39 | ret void, !dbg !40 |
| 40 | } |
| 41 | |
| 42 | declare i32 @use(...) local_unnamed_addr |
| 43 | |
| 44 | ; Function Attrs: nounwind readnone speculatable |
| 45 | declare void @llvm.dbg.value(metadata, metadata, metadata) #1 |
| 46 | |
| 47 | attributes #0 = { nounwind ssp } |
| 48 | attributes #1 = { nounwind readnone speculatable } |
| 49 | attributes #2 = { nobuiltin nounwind } |
| 50 | |
| 51 | !llvm.dbg.cu = !{!0} |
| 52 | !llvm.module.flags = !{!5, !6, !7, !8, !9} |
| 53 | !llvm.ident = !{!10} |
| 54 | |
| 55 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 (trunk 317434) (llvm/trunk 317437)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3) |
| 56 | !1 = !DIFile(filename: "test.i", directory: "/Data/radar/31209283") |
| 57 | !2 = !{} |
| 58 | !3 = !{!4} |
| 59 | !4 = !DIBasicType(name: "long long unsigned int", size: 64, encoding: DW_ATE_unsigned) |
| 60 | !5 = !{i32 2, !"Dwarf Version", i32 2} |
| 61 | !6 = !{i32 2, !"Debug Info Version", i32 3} |
| 62 | !7 = !{i32 1, !"wchar_size", i32 4} |
| 63 | !8 = !{i32 1, !"min_enum_size", i32 4} |
| 64 | !9 = !{i32 7, !"PIC Level", i32 2} |
| 65 | !10 = !{!"clang version 6.0.0 (trunk 317434) (llvm/trunk 317437)"} |
| 66 | !11 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 6, type: !12, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !20) |
| 67 | !12 = !DISubroutineType(types: !13) |
| 68 | !13 = !{null, !14, !19} |
| 69 | !14 = !DIDerivedType(tag: DW_TAG_typedef, name: "v_t", file: !1, line: 1, baseType: !15) |
| 70 | !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 32) |
| 71 | !16 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "v", file: !1, line: 2, size: 64, elements: !17) |
| 72 | !17 = !{!18} |
| 73 | !18 = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: !16, file: !1, line: 3, baseType: !4, size: 64) |
| 74 | !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 32) |
| 75 | !20 = !{!21, !22, !23, !25, !26} |
| 76 | !21 = !DILocalVariable(name: "object", arg: 1, scope: !11, file: !1, line: 6, type: !14) |
| 77 | !22 = !DILocalVariable(name: "start", arg: 2, scope: !11, file: !1, line: 6, type: !19) |
| 78 | !23 = !DILocalVariable(name: "head_size", scope: !11, file: !1, line: 7, type: !24) |
| 79 | !24 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned) |
| 80 | !25 = !DILocalVariable(name: "orig_start", scope: !11, file: !1, line: 8, type: !4) |
| 81 | !26 = !DILocalVariable(name: "offset", scope: !11, file: !1, line: 9, type: !4) |
| 82 | !27 = !DILocation(line: 6, column: 20, scope: !11) |
| 83 | !28 = !DILocation(line: 6, column: 48, scope: !11) |
| 84 | !29 = !DILocation(line: 7, column: 12, scope: !11) |
| 85 | !30 = !DILocation(line: 10, column: 16, scope: !11) |
| 86 | !31 = !DILocation(line: 11, column: 5, scope: !32) |
| 87 | !32 = distinct !DILexicalBlock(scope: !11, file: !1, line: 11, column: 5) |
| 88 | !33 = !DILocation(line: 8, column: 22, scope: !11) |
| 89 | !34 = !DILocation(line: 13, column: 7, scope: !35) |
| 90 | !35 = distinct !DILexicalBlock(scope: !36, file: !1, line: 12, column: 75) |
| 91 | !36 = distinct !DILexicalBlock(scope: !32, file: !1, line: 11, column: 5) |
| 92 | !37 = !DILocation(line: 12, column: 61, scope: !36) |
| 93 | !38 = distinct !{!38, !31, !39} |
| 94 | !39 = !DILocation(line: 14, column: 3, scope: !32) |
| 95 | !40 = !DILocation(line: 15, column: 1, scope: !11) |