136 lines · plain
1; RUN: rm -rf %t && mkdir -p %t2; RUN: sed -e 's|PATTERN|%/t|g' %s | opt -passes=insert-gcov-profiling -disable-output3 4; This is a crash test.5 6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"7target triple = "x86_64-unknown-linux-gnu"8 9%struct.vector = type { i8 }10 11; Function Attrs: nounwind12define i32 @_Z4testv() !dbg !15 {13entry:14 %retval = alloca i32, align 415 %__range = alloca ptr, align 816 %ref.tmp = alloca %struct.vector, align 117 %undef.agg.tmp = alloca %struct.vector, align 118 %__begin = alloca ptr, align 819 %__end = alloca ptr, align 820 %spec = alloca i8, align 121 call void @llvm.dbg.declare(metadata ptr %__range, metadata !27, metadata !DIExpression()), !dbg !3022 br label %023 24; <label>:0 ; preds = %entry25 call void @_Z13TagFieldSpecsv(), !dbg !3126 store ptr %ref.tmp, ptr %__range, align 8, !dbg !3127 call void @llvm.dbg.declare(metadata ptr %__begin, metadata !32, metadata !DIExpression()), !dbg !3028 %1 = load ptr, ptr %__range, align 8, !dbg !3129 %call = call ptr @_ZN6vector5beginEv(ptr %1), !dbg !3130 store ptr %call, ptr %__begin, align 8, !dbg !3131 call void @llvm.dbg.declare(metadata ptr %__end, metadata !33, metadata !DIExpression()), !dbg !3032 %2 = load ptr, ptr %__range, align 8, !dbg !3133 %call1 = call ptr @_ZN6vector3endEv(ptr %2), !dbg !3134 store ptr %call1, ptr %__end, align 8, !dbg !3135 br label %for.cond, !dbg !3136 37for.cond: ; preds = %for.inc, %038 %3 = load ptr, ptr %__begin, align 8, !dbg !3439 %4 = load ptr, ptr %__end, align 8, !dbg !3440 %cmp = icmp ne ptr %3, %4, !dbg !3441 br i1 %cmp, label %for.body, label %for.end, !dbg !3442 43for.body: ; preds = %for.cond44 call void @llvm.dbg.declare(metadata ptr %spec, metadata !37, metadata !DIExpression()), !dbg !3145 %5 = load ptr, ptr %__begin, align 8, !dbg !3846 %6 = load i8, ptr %5, align 1, !dbg !3847 store i8 %6, ptr %spec, align 1, !dbg !3848 br label %for.inc, !dbg !3849 50for.inc: ; preds = %for.body51 %7 = load ptr, ptr %__begin, align 8, !dbg !4052 %incdec.ptr = getelementptr inbounds i8, ptr %7, i32 1, !dbg !4053 store ptr %incdec.ptr, ptr %__begin, align 8, !dbg !4054 br label %for.cond, !dbg !4055 56for.end: ; preds = %for.cond57 call void @llvm.trap(), !dbg !4258 unreachable, !dbg !4259 60return: ; No predecessors!61 %8 = load i32, ptr %retval, !dbg !4462 ret i32 %8, !dbg !4463}64 65; Function Attrs: nounwind readnone66declare void @llvm.dbg.declare(metadata, metadata, metadata)67 68declare void @_Z13TagFieldSpecsv()69 70declare ptr @_ZN6vector5beginEv(ptr)71 72declare ptr @_ZN6vector3endEv(ptr)73 74; Function Attrs: noreturn nounwind75declare void @llvm.trap()76 77; Function Attrs: nounwind78define void @_Z2f1v() !dbg !20 {79entry:80 br label %081 82; <label>:0 ; preds = %entry83 ret void, !dbg !4584}85 86!llvm.dbg.cu = !{!0}87!llvm.module.flags = !{!23, !24}88!llvm.gcov = !{!25}89!llvm.ident = !{!26}90 91!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (trunk 209871)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)92!1 = !DIFile(filename: "<stdin>", directory: "PATTERN")93!2 = !{}94!3 = !{!4}95!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "vector", line: 21, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS6vector")96!5 = !DIFile(filename: "linezero.cc", directory: "PATTERN")97!6 = !{!7, !13}98!7 = !DISubprogram(name: "begin", linkageName: "_ZN6vector5beginEv", line: 25, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 25, file: !5, scope: !4, type: !8)99!8 = !DISubroutineType(types: !9)100!9 = !{!10, !12}101!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11)102!11 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)103!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)104!13 = !DISubprogram(name: "end", linkageName: "_ZN6vector3endEv", line: 26, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 26, file: !5, scope: !4, type: !8)105!15 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", line: 50, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 50, file: !5, scope: !16, type: !17, retainedNodes: !2)106!16 = !DIFile(filename: "linezero.cc", directory: "PATTERN")107!17 = !DISubroutineType(types: !18)108!18 = !{!19}109!19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)110!20 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 54, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 54, file: !5, scope: !16, type: !21, retainedNodes: !2)111!21 = !DISubroutineType(types: !22)112!22 = !{null}113!23 = !{i32 2, !"Dwarf Version", i32 4}114!24 = !{i32 2, !"Debug Info Version", i32 3}115!25 = !{!"PATTERN/linezero.o", !0}116!26 = !{!"clang version 3.5.0 (trunk 209871)"}117!27 = !DILocalVariable(name: "__range", flags: DIFlagArtificial, scope: !28, type: !29)118!28 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !15)119!29 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !4)120!30 = !DILocation(line: 0, scope: !28)121!31 = !DILocation(line: 51, scope: !28)122!32 = !DILocalVariable(name: "__begin", flags: DIFlagArtificial, scope: !28, type: !10)123!33 = !DILocalVariable(name: "__end", flags: DIFlagArtificial, scope: !28, type: !10)124!34 = !DILocation(line: 51, scope: !35)125!35 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !36)126!36 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28)127!37 = !DILocalVariable(name: "spec", line: 51, scope: !28, file: !16, type: !11)128!38 = !DILocation(line: 51, scope: !39)129!39 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28)130!40 = !DILocation(line: 51, scope: !41)131!41 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28)132!42 = !DILocation(line: 51, scope: !43)133!43 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28)134!44 = !DILocation(line: 52, scope: !15)135!45 = !DILocation(line: 54, scope: !20)136