Benjamin Kramer | 23445ca | 2015-03-11 13:55:41 +0000 | [diff] [blame] | 1 | ; RUN: sed -e 's|PATTERN|%/T|g' %s | opt -insert-gcov-profiling -disable-output |
| 2 | ; RUN: rm %T/linezero.gcno |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 3 | |
Xinliang David Li | 64dbb29 | 2016-06-05 05:12:23 +0000 | [diff] [blame] | 4 | ; RUN: sed -e 's|PATTERN|%/T|g' %s | opt -passes=insert-gcov-profiling -disable-output |
| 5 | ; RUN: rm %T/linezero.gcno |
| 6 | |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 7 | ; This is a crash test. |
| 8 | |
| 9 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 10 | target triple = "x86_64-unknown-linux-gnu" |
| 11 | |
| 12 | %struct.vector = type { i8 } |
| 13 | |
| 14 | ; Function Attrs: nounwind |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 15 | define i32 @_Z4testv() #0 !dbg !15 { |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 16 | entry: |
| 17 | %retval = alloca i32, align 4 |
| 18 | %__range = alloca %struct.vector*, align 8 |
| 19 | %ref.tmp = alloca %struct.vector, align 1 |
| 20 | %undef.agg.tmp = alloca %struct.vector, align 1 |
| 21 | %__begin = alloca i8*, align 8 |
| 22 | %__end = alloca i8*, align 8 |
| 23 | %spec = alloca i8, align 1 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 24 | call void @llvm.dbg.declare(metadata %struct.vector** %__range, metadata !27, metadata !DIExpression()), !dbg !30 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 25 | br label %0 |
| 26 | |
| 27 | ; <label>:0 ; preds = %entry |
| 28 | call void @_Z13TagFieldSpecsv(), !dbg !31 |
| 29 | store %struct.vector* %ref.tmp, %struct.vector** %__range, align 8, !dbg !31 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 30 | call void @llvm.dbg.declare(metadata i8** %__begin, metadata !32, metadata !DIExpression()), !dbg !30 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 31 | %1 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 32 | %call = call i8* @_ZN6vector5beginEv(%struct.vector* %1), !dbg !31 |
| 33 | store i8* %call, i8** %__begin, align 8, !dbg !31 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 34 | call void @llvm.dbg.declare(metadata i8** %__end, metadata !33, metadata !DIExpression()), !dbg !30 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 35 | %2 = load %struct.vector*, %struct.vector** %__range, align 8, !dbg !31 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 36 | %call1 = call i8* @_ZN6vector3endEv(%struct.vector* %2), !dbg !31 |
| 37 | store i8* %call1, i8** %__end, align 8, !dbg !31 |
| 38 | br label %for.cond, !dbg !31 |
| 39 | |
| 40 | for.cond: ; preds = %for.inc, %0 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 41 | %3 = load i8*, i8** %__begin, align 8, !dbg !34 |
| 42 | %4 = load i8*, i8** %__end, align 8, !dbg !34 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 43 | %cmp = icmp ne i8* %3, %4, !dbg !34 |
| 44 | br i1 %cmp, label %for.body, label %for.end, !dbg !34 |
| 45 | |
| 46 | for.body: ; preds = %for.cond |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 47 | call void @llvm.dbg.declare(metadata i8* %spec, metadata !37, metadata !DIExpression()), !dbg !31 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 48 | %5 = load i8*, i8** %__begin, align 8, !dbg !38 |
| 49 | %6 = load i8, i8* %5, align 1, !dbg !38 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 50 | store i8 %6, i8* %spec, align 1, !dbg !38 |
| 51 | br label %for.inc, !dbg !38 |
| 52 | |
| 53 | for.inc: ; preds = %for.body |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 54 | %7 = load i8*, i8** %__begin, align 8, !dbg !40 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 55 | %incdec.ptr = getelementptr inbounds i8, i8* %7, i32 1, !dbg !40 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 56 | store i8* %incdec.ptr, i8** %__begin, align 8, !dbg !40 |
| 57 | br label %for.cond, !dbg !40 |
| 58 | |
| 59 | for.end: ; preds = %for.cond |
| 60 | call void @llvm.trap(), !dbg !42 |
| 61 | unreachable, !dbg !42 |
| 62 | |
| 63 | return: ; No predecessors! |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 64 | %8 = load i32, i32* %retval, !dbg !44 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 65 | ret i32 %8, !dbg !44 |
| 66 | } |
| 67 | |
| 68 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 69 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 70 | |
| 71 | declare void @_Z13TagFieldSpecsv() #2 |
| 72 | |
| 73 | declare i8* @_ZN6vector5beginEv(%struct.vector*) #2 |
| 74 | |
| 75 | declare i8* @_ZN6vector3endEv(%struct.vector*) #2 |
| 76 | |
| 77 | ; Function Attrs: noreturn nounwind |
| 78 | declare void @llvm.trap() #3 |
| 79 | |
| 80 | ; Function Attrs: nounwind |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 81 | define void @_Z2f1v() #0 !dbg !20 { |
Nick Lewycky | 5f53ddd | 2014-06-03 04:25:36 +0000 | [diff] [blame] | 82 | entry: |
| 83 | br label %0 |
| 84 | |
| 85 | ; <label>:0 ; preds = %entry |
| 86 | ret void, !dbg !45 |
| 87 | } |
| 88 | |
| 89 | attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 90 | attributes #1 = { nounwind readnone } |
| 91 | attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 92 | attributes #3 = { noreturn nounwind } |
| 93 | |
| 94 | !llvm.dbg.cu = !{!0} |
| 95 | !llvm.module.flags = !{!23, !24} |
| 96 | !llvm.gcov = !{!25} |
| 97 | !llvm.ident = !{!26} |
| 98 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 99 | !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) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 100 | !1 = !DIFile(filename: "<stdin>", directory: "PATTERN") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 101 | !2 = !{} |
| 102 | !3 = !{!4} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 103 | !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "vector", line: 21, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS6vector") |
| 104 | !5 = !DIFile(filename: "linezero.cc", directory: "PATTERN") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 105 | !6 = !{!7, !13} |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 106 | !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) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 107 | !8 = !DISubroutineType(types: !9) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 108 | !9 = !{!10, !12} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 109 | !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !11) |
| 110 | !11 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 111 | !12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4) |
| 112 | !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) |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 113 | !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, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 114 | !16 = !DIFile(filename: "linezero.cc", directory: "PATTERN") |
| 115 | !17 = !DISubroutineType(types: !18) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 116 | !18 = !{!19} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 117 | !19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 118 | !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, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 119 | !21 = !DISubroutineType(types: !22) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 120 | !22 = !{null} |
| 121 | !23 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 122 | !24 = !{i32 2, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 123 | !25 = !{!"PATTERN/linezero.o", !0} |
| 124 | !26 = !{!"clang version 3.5.0 (trunk 209871)"} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 125 | !27 = !DILocalVariable(name: "__range", flags: DIFlagArtificial, scope: !28, type: !29) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 126 | !28 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !15) |
Duncan P. N. Exon Smith | a59d3e5 | 2016-04-23 21:08:00 +0000 | [diff] [blame] | 127 | !29 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !4) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 128 | !30 = !DILocation(line: 0, scope: !28) |
| 129 | !31 = !DILocation(line: 51, scope: !28) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 130 | !32 = !DILocalVariable(name: "__begin", flags: DIFlagArtificial, scope: !28, type: !10) |
| 131 | !33 = !DILocalVariable(name: "__end", flags: DIFlagArtificial, scope: !28, type: !10) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 132 | !34 = !DILocation(line: 51, scope: !35) |
| 133 | !35 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !36) |
| 134 | !36 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 135 | !37 = !DILocalVariable(name: "spec", line: 51, scope: !28, file: !16, type: !11) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 136 | !38 = !DILocation(line: 51, scope: !39) |
| 137 | !39 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28) |
| 138 | !40 = !DILocation(line: 51, scope: !41) |
| 139 | !41 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28) |
| 140 | !42 = !DILocation(line: 51, scope: !43) |
| 141 | !43 = distinct !DILexicalBlock(line: 51, column: 0, file: !5, scope: !28) |
| 142 | !44 = !DILocation(line: 52, scope: !15) |
| 143 | !45 = !DILocation(line: 54, scope: !20) |