blob: a964688cd979455ef70325cf8effe254c09ecb05 [file] [log] [blame]
Adrian Prantl67c24422017-02-17 19:42:32 +00001; PR31381: An assertion in the DWARF backend when fragments in MMI slots are
2; sorted by largest offset first.
3; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s
4; CHECK: DW_TAG_formal_parameter
5; CHECK: DW_TAG_formal_parameter
6; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (<0xa> 91 78 93 03 93 06 91 7d 93 03 )
7; fbreg -8, piece 0x00000003, piece 0x00000006, fbreg -3, piece 0x00000003
8; CHECK-NEXT: DW_AT_abstract_origin {{.*}}"p"
9source_filename = "bugpoint-reduced-simplified.ll"
10target triple = "x86_64-apple-darwin"
11
12@f = common local_unnamed_addr global i32 0, align 4, !dbg !0
13@h = common local_unnamed_addr global i32 0, align 4, !dbg !6
14
15; Function Attrs: nounwind readnone
16declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
17
18define void @fn4() local_unnamed_addr !dbg !12 {
19entry:
20 %l1.sroa.7.i = alloca [3 x i8], align 1
21 tail call void @llvm.dbg.declare(metadata [3 x i8]* %l1.sroa.7.i, metadata !15, metadata !26), !dbg !27
22 %i.sroa.4.i = alloca [3 x i8], align 8
23 tail call void @llvm.dbg.declare(metadata [3 x i8]* %i.sroa.4.i, metadata !15, metadata !32), !dbg !27
24 %0 = load i32, i32* @h, align 4
25 br label %while.body.i.i, !dbg !33
26
27while.body.i.i: ; preds = %while.body.i.i, %entry
28 br label %while.body.i.i, !dbg !34
29
30fn3.exit: ; No predecessors!
31 %1 = load i32, i32* @f, align 4
32 %tobool.i = icmp eq i32 %1, 0
33 br label %while.body.i
34
35while.body.i: ; preds = %if.end.i, %fn3.exit
36 br i1 %tobool.i, label %if.end.i, label %if.then.i
37
38if.then.i: ; preds = %while.body.i
39 br label %if.end.i
40
41if.end.i: ; preds = %if.then.i, %while.body.i
42 br label %while.body.i
43}
44
45attributes #0 = { nounwind readnone }
46
47!llvm.dbg.cu = !{!2}
48!llvm.module.flags = !{!9, !10, !11}
49
50!0 = !DIGlobalVariableExpression(var: !1)
51!1 = distinct !DIGlobalVariable(name: "f", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true)
52!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
53!3 = !DIFile(filename: "PR31381.c", directory: "/")
54!4 = !{}
55!5 = !{!0, !6}
56!6 = !DIGlobalVariableExpression(var: !7)
57!7 = distinct !DIGlobalVariable(name: "h", scope: !2, file: !3, line: 8, type: !8, isLocal: false, isDefinition: true)
58!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
59!9 = !{i32 2, !"Dwarf Version", i32 4}
60!10 = !{i32 2, !"Debug Info Version", i32 3}
61!11 = !{i32 1, !"PIC Level", i32 2}
62!12 = distinct !DISubprogram(name: "fn4", scope: !3, file: !3, line: 31, type: !13, isLocal: false, isDefinition: true, scopeLine: 32, isOptimized: true, unit: !2, variables: !4)
63!13 = !DISubroutineType(types: !14)
64!14 = !{null}
65!15 = !DILocalVariable(name: "p", arg: 1, scope: !16, file: !3, line: 19, type: !19)
66!16 = distinct !DISubprogram(name: "fn2", scope: !3, file: !3, line: 19, type: !17, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !25)
67!17 = !DISubroutineType(types: !18)
68!18 = !{null, !19}
69!19 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, size: 96, elements: !20)
70!20 = !{!21, !23, !24}
71!21 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !19, file: !3, line: 4, baseType: !22, size: 8, offset: 24)
72!22 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
73!23 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !3, line: 5, baseType: !8, size: 32, offset: 32)
74!24 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !19, file: !3, line: 6, baseType: !8, size: 6, offset: 64, flags: DIFlagBitField, extraData: i64 64)
75!25 = !{!15}
76!26 = !DIExpression(DW_OP_LLVM_fragment, 72, 24)
77!27 = !DILocation(line: 19, column: 20, scope: !16, inlinedAt: !28)
78!28 = distinct !DILocation(line: 27, column: 3, scope: !29, inlinedAt: !30)
79!29 = distinct !DISubprogram(name: "fn3", scope: !3, file: !3, line: 24, type: !13, isLocal: false, isDefinition: true, scopeLine: 25, isOptimized: true, unit: !2, variables: !4)
80!30 = distinct !DILocation(line: 34, column: 7, scope: !31)
81!31 = distinct !DILexicalBlock(scope: !12, file: !3, line: 33, column: 5)
82!32 = !DIExpression(DW_OP_LLVM_fragment, 0, 24)
83!33 = !DILocation(line: 22, column: 9, scope: !16, inlinedAt: !28)
84!34 = !DILocation(line: 21, column: 3, scope: !35, inlinedAt: !28)
85!35 = !DILexicalBlockFile(scope: !16, file: !3, discriminator: 2)