1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; Radar 9309221 3*9880d681SAndroid Build Coastguard Worker; Test dwarf reg no for d16 4*9880d681SAndroid Build Coastguard Worker;CHECK: DW_OP_regx 5*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: 272 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32" 8*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-darwin10" 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [11 x i8] c"%p %lf %c\0A\00", align 4 11*9880d681SAndroid Build Coastguard Worker@.str1 = private unnamed_addr constant [6 x i8] c"point\00", align 4 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Workerdefine i32 @inlineprinter(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize !dbg !9 { 14*9880d681SAndroid Build Coastguard Workerentry: 15*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !19, metadata !DIExpression()), !dbg !26 16*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata double %val, i64 0, metadata !20, metadata !DIExpression()), !dbg !26 17*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8 %c, i64 0, metadata !21, metadata !DIExpression()), !dbg !26 18*9880d681SAndroid Build Coastguard Worker %0 = zext i8 %c to i32, !dbg !27 19*9880d681SAndroid Build Coastguard Worker %1 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* %ptr, double %val, i32 %0) nounwind, !dbg !27 20*9880d681SAndroid Build Coastguard Worker ret i32 0, !dbg !29 21*9880d681SAndroid Build Coastguard Worker} 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Workerdefine i32 @printer(i8* %ptr, double %val, i8 zeroext %c) nounwind optsize noinline !dbg !0 { 24*9880d681SAndroid Build Coastguard Workerentry: 25*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8* %ptr, i64 0, metadata !16, metadata !DIExpression()), !dbg !30 26*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata double %val, i64 0, metadata !17, metadata !DIExpression()), !dbg !30 27*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8 %c, i64 0, metadata !18, metadata !DIExpression()), !dbg !30 28*9880d681SAndroid Build Coastguard Worker %0 = zext i8 %c to i32, !dbg !31 29*9880d681SAndroid Build Coastguard Worker %1 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* %ptr, double %val, i32 %0) nounwind, !dbg !31 30*9880d681SAndroid Build Coastguard Worker ret i32 0, !dbg !33 31*9880d681SAndroid Build Coastguard Worker} 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8* nocapture, ...) nounwind 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Workerdefine i32 @main(i32 %argc, i8** nocapture %argv) nounwind optsize !dbg !10 { 38*9880d681SAndroid Build Coastguard Workerentry: 39*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !22, metadata !DIExpression()), !dbg !34 40*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !23, metadata !DIExpression()), !dbg !34 41*9880d681SAndroid Build Coastguard Worker %0 = sitofp i32 %argc to double, !dbg !35 42*9880d681SAndroid Build Coastguard Worker %1 = fadd double %0, 5.555552e+05, !dbg !35 43*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata double %1, i64 0, metadata !24, metadata !DIExpression()), !dbg !35 44*9880d681SAndroid Build Coastguard Worker %2 = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str1, i32 0, i32 0)) nounwind, !dbg !36 45*9880d681SAndroid Build Coastguard Worker %3 = getelementptr inbounds i8, i8* bitcast (i32 (i32, i8**)* @main to i8*), i32 %argc, !dbg !37 46*9880d681SAndroid Build Coastguard Worker %4 = trunc i32 %argc to i8, !dbg !37 47*9880d681SAndroid Build Coastguard Worker %5 = add i8 %4, 97, !dbg !37 48*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8* %3, i64 0, metadata !49, metadata !DIExpression()) nounwind, !dbg !38 49*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata double %1, i64 0, metadata !50, metadata !DIExpression()) nounwind, !dbg !38 50*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i8 %5, i64 0, metadata !51, metadata !DIExpression()) nounwind, !dbg !38 51*9880d681SAndroid Build Coastguard Worker %6 = zext i8 %5 to i32, !dbg !39 52*9880d681SAndroid Build Coastguard Worker %7 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* %3, double %1, i32 %6) nounwind, !dbg !39 53*9880d681SAndroid Build Coastguard Worker %8 = tail call i32 @printer(i8* %3, double %1, i8 zeroext %5) nounwind, !dbg !40 54*9880d681SAndroid Build Coastguard Worker ret i32 0, !dbg !41 55*9880d681SAndroid Build Coastguard Worker} 56*9880d681SAndroid Build Coastguard Worker 57*9880d681SAndroid Build Coastguard Workerdeclare i32 @puts(i8* nocapture) nounwind 58*9880d681SAndroid Build Coastguard Worker 59*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!2} 60*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!48} 61*9880d681SAndroid Build Coastguard Worker 62*9880d681SAndroid Build Coastguard Worker!0 = distinct !DISubprogram(name: "printer", linkageName: "printer", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 12, file: !46, scope: !1, type: !3, variables: !43) 63*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "a.c", directory: "/tmp/") 64*9880d681SAndroid Build Coastguard Worker!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "(LLVM build 00)", isOptimized: true, emissionKind: FullDebug, file: !46, enums: !47, retainedTypes: !47, imports: null) 65*9880d681SAndroid Build Coastguard Worker!3 = !DISubroutineType(types: !4) 66*9880d681SAndroid Build Coastguard Worker!4 = !{!5, !6, !7, !8} 67*9880d681SAndroid Build Coastguard Worker!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 68*9880d681SAndroid Build Coastguard Worker!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: null) 69*9880d681SAndroid Build Coastguard Worker!7 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 32, encoding: DW_ATE_float) 70*9880d681SAndroid Build Coastguard Worker!8 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) 71*9880d681SAndroid Build Coastguard Worker!9 = distinct !DISubprogram(name: "inlineprinter", linkageName: "inlineprinter", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 5, file: !46, scope: !1, type: !3, variables: !44) 72*9880d681SAndroid Build Coastguard Worker!10 = distinct !DISubprogram(name: "main", linkageName: "main", line: 18, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 18, file: !46, scope: !1, type: !11, variables: !45) 73*9880d681SAndroid Build Coastguard Worker!11 = !DISubroutineType(types: !12) 74*9880d681SAndroid Build Coastguard Worker!12 = !{!5, !5, !13} 75*9880d681SAndroid Build Coastguard Worker!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !14) 76*9880d681SAndroid Build Coastguard Worker!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !15) 77*9880d681SAndroid Build Coastguard Worker!15 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) 78*9880d681SAndroid Build Coastguard Worker!16 = !DILocalVariable(name: "ptr", line: 11, arg: 1, scope: !0, file: !1, type: !6) 79*9880d681SAndroid Build Coastguard Worker!17 = !DILocalVariable(name: "val", line: 11, arg: 2, scope: !0, file: !1, type: !7) 80*9880d681SAndroid Build Coastguard Worker!18 = !DILocalVariable(name: "c", line: 11, arg: 3, scope: !0, file: !1, type: !8) 81*9880d681SAndroid Build Coastguard Worker!19 = !DILocalVariable(name: "ptr", line: 4, arg: 1, scope: !9, file: !1, type: !6) 82*9880d681SAndroid Build Coastguard Worker!20 = !DILocalVariable(name: "val", line: 4, arg: 2, scope: !9, file: !1, type: !7) 83*9880d681SAndroid Build Coastguard Worker!21 = !DILocalVariable(name: "c", line: 4, arg: 3, scope: !9, file: !1, type: !8) 84*9880d681SAndroid Build Coastguard Worker 85*9880d681SAndroid Build Coastguard Worker!49 = !DILocalVariable(name: "ptr", line: 4, arg: 1, scope: !9, file: !1, type: !6) 86*9880d681SAndroid Build Coastguard Worker!50 = !DILocalVariable(name: "val", line: 4, arg: 2, scope: !9, file: !1, type: !7) 87*9880d681SAndroid Build Coastguard Worker!51 = !DILocalVariable(name: "c", line: 4, arg: 2, scope: !9, file: !1, type: !8) 88*9880d681SAndroid Build Coastguard Worker 89*9880d681SAndroid Build Coastguard Worker!22 = !DILocalVariable(name: "argc", line: 17, arg: 1, scope: !10, file: !1, type: !5) 90*9880d681SAndroid Build Coastguard Worker!23 = !DILocalVariable(name: "argv", line: 17, arg: 2, scope: !10, file: !1, type: !13) 91*9880d681SAndroid Build Coastguard Worker!24 = !DILocalVariable(name: "dval", line: 19, scope: !25, file: !1, type: !7) 92*9880d681SAndroid Build Coastguard Worker!25 = distinct !DILexicalBlock(line: 18, column: 0, file: !46, scope: !10) 93*9880d681SAndroid Build Coastguard Worker!26 = !DILocation(line: 4, scope: !9) 94*9880d681SAndroid Build Coastguard Worker!27 = !DILocation(line: 6, scope: !28) 95*9880d681SAndroid Build Coastguard Worker!28 = distinct !DILexicalBlock(line: 5, column: 0, file: !46, scope: !9) 96*9880d681SAndroid Build Coastguard Worker!29 = !DILocation(line: 7, scope: !28) 97*9880d681SAndroid Build Coastguard Worker!30 = !DILocation(line: 11, scope: !0) 98*9880d681SAndroid Build Coastguard Worker!31 = !DILocation(line: 13, scope: !32) 99*9880d681SAndroid Build Coastguard Worker!32 = distinct !DILexicalBlock(line: 12, column: 0, file: !46, scope: !0) 100*9880d681SAndroid Build Coastguard Worker!33 = !DILocation(line: 14, scope: !32) 101*9880d681SAndroid Build Coastguard Worker!34 = !DILocation(line: 17, scope: !10) 102*9880d681SAndroid Build Coastguard Worker!35 = !DILocation(line: 19, scope: !25) 103*9880d681SAndroid Build Coastguard Worker!36 = !DILocation(line: 20, scope: !25) 104*9880d681SAndroid Build Coastguard Worker!37 = !DILocation(line: 21, scope: !25) 105*9880d681SAndroid Build Coastguard Worker!38 = !DILocation(line: 4, scope: !9, inlinedAt: !37) 106*9880d681SAndroid Build Coastguard Worker!39 = !DILocation(line: 6, scope: !28, inlinedAt: !37) 107*9880d681SAndroid Build Coastguard Worker!40 = !DILocation(line: 22, scope: !25) 108*9880d681SAndroid Build Coastguard Worker!41 = !DILocation(line: 23, scope: !25) 109*9880d681SAndroid Build Coastguard Worker!43 = !{!16, !17, !18} 110*9880d681SAndroid Build Coastguard Worker!44 = !{!19, !20, !21} 111*9880d681SAndroid Build Coastguard Worker!45 = !{!22, !23, !24} 112*9880d681SAndroid Build Coastguard Worker!46 = !DIFile(filename: "a.c", directory: "/tmp/") 113*9880d681SAndroid Build Coastguard Worker!47 = !{} 114*9880d681SAndroid Build Coastguard Worker!48 = !{i32 1, !"Debug Info Version", i32 3} 115