1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu" 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker%class.A = type { i8 } 7*9880d681SAndroid Build Coastguard Worker%class.B = type { i8 } 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 10*9880d681SAndroid Build Coastguard Worker@.str.1 = private unnamed_addr constant [6 x i8] c"false\00", align 1 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Workerdefine void @_Z11PrintVectorv() local_unnamed_addr #0 !dbg !6 { 13*9880d681SAndroid Build Coastguard Workerentry: 14*9880d681SAndroid Build Coastguard Worker %agg.tmp.i.i = alloca %class.A, align 1 15*9880d681SAndroid Build Coastguard Worker %text.i = alloca %class.A, align 1 16*9880d681SAndroid Build Coastguard Worker %v = alloca %class.B, align 1 17*9880d681SAndroid Build Coastguard Worker %0 = getelementptr inbounds %class.B, %class.B* %v, i64 0, i32 0, !dbg !40 18*9880d681SAndroid Build Coastguard Worker call void @llvm.lifetime.start(i64 1, i8* %0) #4, !dbg !40 19*9880d681SAndroid Build Coastguard Worker %1 = getelementptr inbounds %class.A, %class.A* %text.i, i64 0, i32 0, !dbg !41 20*9880d681SAndroid Build Coastguard Worker %2 = getelementptr inbounds %class.A, %class.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !59 21*9880d681SAndroid Build Coastguard Worker br label %for.cond, !dbg !65 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Workerfor.cond: ; preds = %for.cond, %entry 24*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata %class.B* %v, i64 0, metadata !29, metadata !66), !dbg !67 25*9880d681SAndroid Build Coastguard Worker %call = call double @_ZN1BixEj(%class.B* nonnull %v, i32 undef), !dbg !68 26*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata double %call, i64 0, metadata !49, metadata !69), !dbg !70 27*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !52, metadata !69), !dbg !71 28*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata %class.A* undef, i64 0, metadata !54, metadata !69), !dbg !72 29*9880d681SAndroid Build Coastguard Worker call void @llvm.lifetime.start(i64 1, i8* %1) #4, !dbg !41 30*9880d681SAndroid Build Coastguard Worker %tobool.i = fcmp une double %call, 0.000000e+00, !dbg !73 31*9880d681SAndroid Build Coastguard Worker %cond.i = select i1 %tobool.i, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), !dbg !73 32*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata %class.A* %text.i, i64 0, metadata !55, metadata !66), !dbg !74 33*9880d681SAndroid Build Coastguard Worker call void @llvm.lifetime.start(i64 1, i8* %2), !dbg !59 34*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata %class.A* %text.i, i64 0, metadata !62, metadata !69), !dbg !59 35*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata i8* %cond.i, i64 0, metadata !63, metadata !69), !dbg !75 36*9880d681SAndroid Build Coastguard Worker call void @_ZN1AC1EPKc(%class.A* nonnull %agg.tmp.i.i, i8* %cond.i), !dbg !76 37*9880d681SAndroid Build Coastguard Worker call void @_ZN1A5m_fn1ES_(%class.A* nonnull %text.i), !dbg !77 38*9880d681SAndroid Build Coastguard Worker call void @llvm.lifetime.end(i64 1, i8* %2), !dbg !79 39*9880d681SAndroid Build Coastguard Worker call void @llvm.lifetime.end(i64 1, i8* %1) #4, !dbg !80 40*9880d681SAndroid Build Coastguard Worker br label %for.cond, !dbg !81, !llvm.loop !82 41*9880d681SAndroid Build Coastguard Worker} 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Worker; Function Attrs: argmemonly nounwind 44*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.lifetime.start(i64, i8* nocapture) #1 45*9880d681SAndroid Build Coastguard Worker 46*9880d681SAndroid Build Coastguard Workerdeclare double @_ZN1BixEj(%class.B*, i32) local_unnamed_addr #2 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker; Function Attrs: argmemonly nounwind 49*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.lifetime.end(i64, i8* nocapture) #1 50*9880d681SAndroid Build Coastguard Worker 51*9880d681SAndroid Build Coastguard Workerdeclare void @_ZN1A5m_fn1ES_(%class.A*) local_unnamed_addr #2 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Workerdeclare void @_ZN1AC1EPKc(%class.A*, i8*) unnamed_addr #2 54*9880d681SAndroid Build Coastguard Worker 55*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone 56*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3 57*9880d681SAndroid Build Coastguard Worker 58*9880d681SAndroid Build Coastguard Workerattributes #0 = { noreturn uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 59*9880d681SAndroid Build Coastguard Workerattributes #1 = { argmemonly nounwind } 60*9880d681SAndroid Build Coastguard Workerattributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 61*9880d681SAndroid Build Coastguard Workerattributes #3 = { nounwind readnone } 62*9880d681SAndroid Build Coastguard Workerattributes #4 = { nounwind } 63*9880d681SAndroid Build Coastguard Worker 64*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0} 65*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!3, !4} 66*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!5} 67*9880d681SAndroid Build Coastguard Worker 68*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 273450) (llvm/trunk 273521)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 69*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "/usr/local/google/home/niravd/bug_28270.c", directory: "/usr/local/google/home/niravd/build/llvm/build_debug") 70*9880d681SAndroid Build Coastguard Worker!2 = !{} 71*9880d681SAndroid Build Coastguard Worker!3 = !{i32 2, !"Dwarf Version", i32 4} 72*9880d681SAndroid Build Coastguard Worker!4 = !{i32 2, !"Debug Info Version", i32 3} 73*9880d681SAndroid Build Coastguard Worker!5 = !{!"clang version 3.9.0 (trunk 273450) (llvm/trunk 273521)"} 74*9880d681SAndroid Build Coastguard Worker!6 = distinct !DISubprogram(name: "PrintVector", linkageName: "_Z11PrintVectorv", scope: !1, file: !1, line: 18, type: !7, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !9) 75*9880d681SAndroid Build Coastguard Worker!7 = !DISubroutineType(types: !8) 76*9880d681SAndroid Build Coastguard Worker!8 = !{null} 77*9880d681SAndroid Build Coastguard Worker!9 = !{!10, !25, !27, !28, !29, !38} 78*9880d681SAndroid Build Coastguard Worker!10 = !DILocalVariable(name: "_text", scope: !6, file: !1, line: 19, type: !11) 79*9880d681SAndroid Build Coastguard Worker!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64) 80*9880d681SAndroid Build Coastguard Worker!12 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, line: 1, size: 8, align: 8, elements: !13, identifier: "_ZTS1A") 81*9880d681SAndroid Build Coastguard Worker!13 = !{!14, !21, !22} 82*9880d681SAndroid Build Coastguard Worker!14 = !DISubprogram(name: "A", scope: !12, file: !1, line: 2, type: !15, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true) 83*9880d681SAndroid Build Coastguard Worker!15 = !DISubroutineType(types: !16) 84*9880d681SAndroid Build Coastguard Worker!16 = !{null, !17, !18} 85*9880d681SAndroid Build Coastguard Worker!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 86*9880d681SAndroid Build Coastguard Worker!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64, align: 64) 87*9880d681SAndroid Build Coastguard Worker!19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !20) 88*9880d681SAndroid Build Coastguard Worker!20 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) 89*9880d681SAndroid Build Coastguard Worker!21 = !DISubprogram(name: "operator+=", linkageName: "_ZN1ApLEPKc", scope: !12, file: !1, line: 5, type: !15, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) 90*9880d681SAndroid Build Coastguard Worker!22 = !DISubprogram(name: "m_fn1", linkageName: "_ZN1A5m_fn1ES_", scope: !12, file: !1, line: 6, type: !23, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) 91*9880d681SAndroid Build Coastguard Worker!23 = !DISubroutineType(types: !24) 92*9880d681SAndroid Build Coastguard Worker!24 = !{null, !17, !12} 93*9880d681SAndroid Build Coastguard Worker!25 = !DILocalVariable(name: "opts", scope: !6, file: !1, line: 20, type: !26) 94*9880d681SAndroid Build Coastguard Worker!26 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 95*9880d681SAndroid Build Coastguard Worker!27 = !DILocalVariable(name: "indent", scope: !6, file: !1, line: 20, type: !26) 96*9880d681SAndroid Build Coastguard Worker!28 = !DILocalVariable(name: "type", scope: !6, file: !1, line: 20, type: !26) 97*9880d681SAndroid Build Coastguard Worker!29 = !DILocalVariable(name: "v", scope: !6, file: !1, line: 21, type: !30) 98*9880d681SAndroid Build Coastguard Worker!30 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "B", file: !1, line: 9, size: 8, align: 8, elements: !31, identifier: "_ZTS1B") 99*9880d681SAndroid Build Coastguard Worker!31 = !{!32} 100*9880d681SAndroid Build Coastguard Worker!32 = !DISubprogram(name: "operator[]", linkageName: "_ZN1BixEj", scope: !30, file: !1, line: 11, type: !33, isLocal: false, isDefinition: false, scopeLine: 11, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true) 101*9880d681SAndroid Build Coastguard Worker!33 = !DISubroutineType(types: !34) 102*9880d681SAndroid Build Coastguard Worker!34 = !{!35, !36, !37} 103*9880d681SAndroid Build Coastguard Worker!35 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) 104*9880d681SAndroid Build Coastguard Worker!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !30, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 105*9880d681SAndroid Build Coastguard Worker!37 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) 106*9880d681SAndroid Build Coastguard Worker!38 = !DILocalVariable(name: "i", scope: !39, file: !1, line: 22, type: !26) 107*9880d681SAndroid Build Coastguard Worker!39 = distinct !DILexicalBlock(scope: !6, file: !1, line: 22, column: 3) 108*9880d681SAndroid Build Coastguard Worker!40 = !DILocation(line: 21, column: 3, scope: !6) 109*9880d681SAndroid Build Coastguard Worker!41 = !DILocation(line: 14, column: 3, scope: !42, inlinedAt: !56) 110*9880d681SAndroid Build Coastguard Worker!42 = distinct !DISubprogram(name: "Print<double>", linkageName: "_Z5PrintIdEvT_iiPiiP1A", scope: !1, file: !1, line: 13, type: !43, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !46, variables: !48) 111*9880d681SAndroid Build Coastguard Worker!43 = !DISubroutineType(types: !44) 112*9880d681SAndroid Build Coastguard Worker!44 = !{null, !35, !26, !26, !45, !26, !11} 113*9880d681SAndroid Build Coastguard Worker!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64, align: 64) 114*9880d681SAndroid Build Coastguard Worker!46 = !{!47} 115*9880d681SAndroid Build Coastguard Worker!47 = !DITemplateTypeParameter(name: "T", type: !35) 116*9880d681SAndroid Build Coastguard Worker!48 = !{!49, !50, !51, !52, !53, !54, !55} 117*9880d681SAndroid Build Coastguard Worker!49 = !DILocalVariable(name: "p1", arg: 1, scope: !42, file: !1, line: 13, type: !35) 118*9880d681SAndroid Build Coastguard Worker!50 = !DILocalVariable(arg: 2, scope: !42, file: !1, line: 13, type: !26) 119*9880d681SAndroid Build Coastguard Worker!51 = !DILocalVariable(arg: 3, scope: !42, file: !1, line: 13, type: !26) 120*9880d681SAndroid Build Coastguard Worker!52 = !DILocalVariable(arg: 4, scope: !42, file: !1, line: 13, type: !45) 121*9880d681SAndroid Build Coastguard Worker!53 = !DILocalVariable(arg: 5, scope: !42, file: !1, line: 13, type: !26) 122*9880d681SAndroid Build Coastguard Worker!54 = !DILocalVariable(name: "p6", arg: 6, scope: !42, file: !1, line: 13, type: !11) 123*9880d681SAndroid Build Coastguard Worker!55 = !DILocalVariable(name: "text", scope: !42, file: !1, line: 14, type: !12) 124*9880d681SAndroid Build Coastguard Worker!56 = distinct !DILocation(line: 23, column: 5, scope: !57) 125*9880d681SAndroid Build Coastguard Worker!57 = !DILexicalBlockFile(scope: !58, file: !1, discriminator: 1) 126*9880d681SAndroid Build Coastguard Worker!58 = distinct !DILexicalBlock(scope: !39, file: !1, line: 22, column: 3) 127*9880d681SAndroid Build Coastguard Worker!59 = !DILocation(line: 0, scope: !60, inlinedAt: !64) 128*9880d681SAndroid Build Coastguard Worker!60 = distinct !DISubprogram(name: "operator+=", linkageName: "_ZN1ApLEPKc", scope: !12, file: !1, line: 5, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !21, variables: !61) 129*9880d681SAndroid Build Coastguard Worker!61 = !{!62, !63} 130*9880d681SAndroid Build Coastguard Worker!62 = !DILocalVariable(name: "this", arg: 1, scope: !60, type: !11, flags: DIFlagArtificial | DIFlagObjectPointer) 131*9880d681SAndroid Build Coastguard Worker!63 = !DILocalVariable(name: "p1", arg: 2, scope: !60, file: !1, line: 5, type: !18) 132*9880d681SAndroid Build Coastguard Worker!64 = distinct !DILocation(line: 15, column: 8, scope: !42, inlinedAt: !56) 133*9880d681SAndroid Build Coastguard Worker!65 = !DILocation(line: 22, column: 8, scope: !39) 134*9880d681SAndroid Build Coastguard Worker!66 = !DIExpression(DW_OP_deref) 135*9880d681SAndroid Build Coastguard Worker!67 = !DILocation(line: 21, column: 5, scope: !6) 136*9880d681SAndroid Build Coastguard Worker!68 = !DILocation(line: 23, column: 11, scope: !58) 137*9880d681SAndroid Build Coastguard Worker!69 = !DIExpression() 138*9880d681SAndroid Build Coastguard Worker!70 = !DILocation(line: 13, column: 36, scope: !42, inlinedAt: !56) 139*9880d681SAndroid Build Coastguard Worker!71 = !DILocation(line: 13, column: 55, scope: !42, inlinedAt: !56) 140*9880d681SAndroid Build Coastguard Worker!72 = !DILocation(line: 13, column: 65, scope: !42, inlinedAt: !56) 141*9880d681SAndroid Build Coastguard Worker!73 = !DILocation(line: 15, column: 11, scope: !42, inlinedAt: !56) 142*9880d681SAndroid Build Coastguard Worker!74 = !DILocation(line: 14, column: 5, scope: !42, inlinedAt: !56) 143*9880d681SAndroid Build Coastguard Worker!75 = !DILocation(line: 5, column: 31, scope: !60, inlinedAt: !64) 144*9880d681SAndroid Build Coastguard Worker!76 = !DILocation(line: 5, column: 43, scope: !60, inlinedAt: !64) 145*9880d681SAndroid Build Coastguard Worker!77 = !DILocation(line: 5, column: 37, scope: !78, inlinedAt: !64) 146*9880d681SAndroid Build Coastguard Worker!78 = !DILexicalBlockFile(scope: !60, file: !1, discriminator: 1) 147*9880d681SAndroid Build Coastguard Worker!79 = !DILocation(line: 5, column: 48, scope: !60, inlinedAt: !64) 148*9880d681SAndroid Build Coastguard Worker!80 = !DILocation(line: 16, column: 1, scope: !42, inlinedAt: !56) 149*9880d681SAndroid Build Coastguard Worker!81 = !DILocation(line: 22, column: 3, scope: !57) 150*9880d681SAndroid Build Coastguard Worker!82 = distinct !{!82, !83} 151*9880d681SAndroid Build Coastguard Worker!83 = !DILocation(line: 22, column: 3, scope: !6) 152