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