| Manman Ren | e9a52e1 | 2013-07-29 18:12:58 +0000 | [diff] [blame] | 1 | ; RUN: llc -O0 -fast-isel=false < %s | FileCheck %s |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 2 | target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" |
| 3 | target triple = "x86_64-apple-macosx10.6.7" |
| 4 | ;Radar 9321650 |
| 5 | |
| 6 | ;CHECK: ##DEBUG_VALUE: my_a |
| 7 | |
| 8 | %class.A = type { i32, i32, i32, i32 } |
| 9 | |
| 10 | define void @_Z3fooi(%class.A* sret %agg.result, i32 %i) ssp { |
| 11 | entry: |
| 12 | %i.addr = alloca i32, align 4 |
| 13 | %j = alloca i32, align 4 |
| 14 | %nrvo = alloca i1 |
| 15 | %cleanup.dest.slot = alloca i32 |
| 16 | store i32 %i, i32* %i.addr, align 4 |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 17 | call void @llvm.dbg.declare(metadata i32* %i.addr, metadata !26, metadata !DIExpression()), !dbg !27 |
| 18 | call void @llvm.dbg.declare(metadata i32* %j, metadata !28, metadata !DIExpression()), !dbg !30 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 19 | store i32 0, i32* %j, align 4, !dbg !31 |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 20 | %tmp = load i32, i32* %i.addr, align 4, !dbg !32 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 21 | %cmp = icmp eq i32 %tmp, 42, !dbg !32 |
| 22 | br i1 %cmp, label %if.then, label %if.end, !dbg !32 |
| 23 | |
| 24 | if.then: ; preds = %entry |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 25 | %tmp1 = load i32, i32* %i.addr, align 4, !dbg !33 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 26 | %add = add nsw i32 %tmp1, 1, !dbg !33 |
| 27 | store i32 %add, i32* %j, align 4, !dbg !33 |
| 28 | br label %if.end, !dbg !35 |
| 29 | |
| 30 | if.end: ; preds = %if.then, %entry |
| 31 | store i1 false, i1* %nrvo, !dbg !36 |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 32 | call void @llvm.dbg.declare(metadata %class.A* %agg.result, metadata !37, metadata !DIExpression()), !dbg !39 |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 33 | %tmp2 = load i32, i32* %j, align 4, !dbg !40 |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 34 | %x = getelementptr inbounds %class.A, %class.A* %agg.result, i32 0, i32 0, !dbg !40 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 35 | store i32 %tmp2, i32* %x, align 4, !dbg !40 |
| 36 | store i1 true, i1* %nrvo, !dbg !41 |
| 37 | store i32 1, i32* %cleanup.dest.slot |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 38 | %nrvo.val = load i1, i1* %nrvo, !dbg !42 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 39 | br i1 %nrvo.val, label %nrvo.skipdtor, label %nrvo.unused, !dbg !42 |
| 40 | |
| 41 | nrvo.unused: ; preds = %if.end |
| 42 | call void @_ZN1AD1Ev(%class.A* %agg.result), !dbg !42 |
| 43 | br label %nrvo.skipdtor, !dbg !42 |
| 44 | |
| 45 | nrvo.skipdtor: ; preds = %nrvo.unused, %if.end |
| 46 | ret void, !dbg !42 |
| 47 | } |
| 48 | |
| Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 49 | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 50 | |
| 51 | define linkonce_odr void @_ZN1AD1Ev(%class.A* %this) unnamed_addr ssp align 2 { |
| 52 | entry: |
| 53 | %this.addr = alloca %class.A*, align 8 |
| 54 | store %class.A* %this, %class.A** %this.addr, align 8 |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 55 | call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !43, metadata !DIExpression()), !dbg !44 |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 56 | %this1 = load %class.A*, %class.A** %this.addr |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 57 | call void @_ZN1AD2Ev(%class.A* %this1) |
| 58 | ret void, !dbg !45 |
| 59 | } |
| 60 | |
| 61 | define linkonce_odr void @_ZN1AD2Ev(%class.A* %this) unnamed_addr nounwind ssp align 2 { |
| 62 | entry: |
| 63 | %this.addr = alloca %class.A*, align 8 |
| 64 | store %class.A* %this, %class.A** %this.addr, align 8 |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 65 | call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !46, metadata !DIExpression()), !dbg !47 |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 66 | %this1 = load %class.A*, %class.A** %this.addr |
| David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 67 | %x = getelementptr inbounds %class.A, %class.A* %this1, i32 0, i32 0, !dbg !48 |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 68 | store i32 1, i32* %x, align 4, !dbg !48 |
| 69 | ret void, !dbg !48 |
| 70 | } |
| 71 | |
| David Blaikie | 47922fb | 2013-03-11 22:37:40 +0000 | [diff] [blame] | 72 | !llvm.dbg.cu = !{!2} |
| Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 73 | !llvm.module.flags = !{!52} |
| Devang Patel | 734f221 | 2011-04-25 16:33:52 +0000 | [diff] [blame] | 74 | |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 75 | !0 = !DISubprogram(name: "~A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !1, type: !11) |
| 76 | !1 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 128, align: 32, file: !51, scope: !2, elements: !4) |
| 77 | !2 = !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.0 (trunk 130127)", isOptimized: false, emissionKind: 1, file: !51, enums: !{}, retainedTypes: !{}, subprograms: !50) |
| 78 | !3 = !DIFile(filename: "a.cc", directory: "/private/tmp") |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 79 | !4 = !{!5, !7, !8, !9, !0, !10, !14} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 80 | !5 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 32, align: 32, file: !51, scope: !3, baseType: !6) |
| 81 | !6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 82 | !7 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 2, size: 32, align: 32, offset: 32, file: !51, scope: !3, baseType: !6) |
| 83 | !8 = !DIDerivedType(tag: DW_TAG_member, name: "z", line: 2, size: 32, align: 32, offset: 64, file: !51, scope: !3, baseType: !6) |
| 84 | !9 = !DIDerivedType(tag: DW_TAG_member, name: "o", line: 2, size: 32, align: 32, offset: 96, file: !51, scope: !3, baseType: !6) |
| 85 | !10 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, file: !51, scope: !1, type: !11) |
| 86 | !11 = !DISubroutineType(types: !12) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 87 | !12 = !{null, !13} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 88 | !13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !3, baseType: !1) |
| 89 | !14 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, file: !51, scope: !1, type: !15) |
| 90 | !15 = !DISubroutineType(types: !16) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 91 | !16 = !{null, !13, !17} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 92 | !17 = !DIDerivedType(tag: DW_TAG_reference_type, scope: !2, baseType: !18) |
| 93 | !18 = !DIDerivedType(tag: DW_TAG_const_type, file: !3, baseType: !1) |
| 94 | !19 = !DISubprogram(name: "foo", linkageName: "_Z3fooi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !20, function: void (%class.A*, i32)* @_Z3fooi) |
| 95 | !20 = !DISubroutineType(types: !21) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 96 | !21 = !{!1} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 97 | !22 = !DISubprogram(name: "~A", linkageName: "_ZN1AD1Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23, function: void (%class.A*)* @_ZN1AD1Ev) |
| 98 | !23 = !DISubroutineType(types: !24) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 99 | !24 = !{null} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 100 | !25 = !DISubprogram(name: "~A", linkageName: "_ZN1AD2Ev", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, file: !51, scope: !3, type: !23, function: void (%class.A*)* @_ZN1AD2Ev) |
| Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 101 | !26 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !19, file: !3, type: !6) |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 102 | !27 = !DILocation(line: 4, column: 11, scope: !19) |
| Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 103 | !28 = !DILocalVariable(name: "j", line: 5, scope: !29, file: !3, type: !6) |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 104 | !29 = distinct !DILexicalBlock(line: 4, column: 14, file: !51, scope: !19) |
| 105 | !30 = !DILocation(line: 5, column: 7, scope: !29) |
| 106 | !31 = !DILocation(line: 5, column: 12, scope: !29) |
| 107 | !32 = !DILocation(line: 6, column: 3, scope: !29) |
| 108 | !33 = !DILocation(line: 7, column: 5, scope: !34) |
| 109 | !34 = distinct !DILexicalBlock(line: 6, column: 16, file: !51, scope: !29) |
| 110 | !35 = !DILocation(line: 8, column: 3, scope: !34) |
| 111 | !36 = !DILocation(line: 9, column: 9, scope: !29) |
| Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 112 | !37 = !DILocalVariable(name: "my_a", line: 9, scope: !29, file: !3, type: !38) |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 113 | !38 = !DIDerivedType(tag: DW_TAG_reference_type, file: !3, baseType: !1) |
| 114 | !39 = !DILocation(line: 9, column: 5, scope: !29) |
| 115 | !40 = !DILocation(line: 10, column: 3, scope: !29) |
| 116 | !41 = !DILocation(line: 11, column: 3, scope: !29) |
| 117 | !42 = !DILocation(line: 12, column: 1, scope: !29) |
| Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 118 | !43 = !DILocalVariable(name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !22, file: !3, type: !13) |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 119 | !44 = !DILocation(line: 2, column: 47, scope: !22) |
| 120 | !45 = !DILocation(line: 2, column: 61, scope: !22) |
| Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame^] | 121 | !46 = !DILocalVariable(name: "this", line: 2, arg: 1, flags: DIFlagArtificial, scope: !25, file: !3, type: !13) |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 122 | !47 = !DILocation(line: 2, column: 47, scope: !25) |
| 123 | !48 = !DILocation(line: 2, column: 54, scope: !49) |
| 124 | !49 = distinct !DILexicalBlock(line: 2, column: 52, file: !51, scope: !25) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 125 | !50 = !{!19, !22, !25} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 126 | !51 = !DIFile(filename: "a.cc", directory: "/private/tmp") |
| Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 127 | !52 = !{i32 1, !"Debug Info Version", i32 3} |