115 lines · plain
1; RUN: llc < %s | FileCheck %s2; Radar 93092213; Test dwarf reg no for d164;CHECK: DW_OP_regx5;CHECK-NEXT: 2726 7target 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"8target triple = "thumbv7-apple-darwin10"9 10@.str = private unnamed_addr constant [11 x i8] c"%p %lf %c\0A\00", align 411@.str1 = private unnamed_addr constant [6 x i8] c"point\00", align 412 13define i32 @inlineprinter(ptr %ptr, double %val, i8 zeroext %c) nounwind optsize !dbg !9 {14entry:15 tail call void @llvm.dbg.value(metadata ptr %ptr, metadata !19, metadata !DIExpression()), !dbg !2616 tail call void @llvm.dbg.value(metadata double %val, metadata !20, metadata !DIExpression()), !dbg !2617 tail call void @llvm.dbg.value(metadata i8 %c, metadata !21, metadata !DIExpression()), !dbg !2618 %0 = zext i8 %c to i32, !dbg !2719 %1 = tail call i32 (ptr, ...) @printf(ptr @.str, ptr %ptr, double %val, i32 %0) nounwind, !dbg !2720 ret i32 0, !dbg !2921}22 23define i32 @printer(ptr %ptr, double %val, i8 zeroext %c) nounwind optsize noinline !dbg !0 {24entry:25 tail call void @llvm.dbg.value(metadata ptr %ptr, metadata !16, metadata !DIExpression()), !dbg !3026 tail call void @llvm.dbg.value(metadata double %val, metadata !17, metadata !DIExpression()), !dbg !3027 tail call void @llvm.dbg.value(metadata i8 %c, metadata !18, metadata !DIExpression()), !dbg !3028 %0 = zext i8 %c to i32, !dbg !3129 %1 = tail call i32 (ptr, ...) @printf(ptr @.str, ptr %ptr, double %val, i32 %0) nounwind, !dbg !3130 ret i32 0, !dbg !3331}32 33declare i32 @printf(ptr nocapture, ...) nounwind34 35declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone36 37define i32 @main(i32 %argc, ptr nocapture %argv) nounwind optsize !dbg !10 {38entry:39 tail call void @llvm.dbg.value(metadata i32 %argc, metadata !22, metadata !DIExpression()), !dbg !3440 tail call void @llvm.dbg.value(metadata ptr %argv, metadata !23, metadata !DIExpression()), !dbg !3441 %0 = sitofp i32 %argc to double, !dbg !3542 %1 = fadd double %0, 5.555552e+05, !dbg !3543 tail call void @llvm.dbg.value(metadata double %1, metadata !24, metadata !DIExpression()), !dbg !3544 %2 = tail call i32 @puts(ptr @.str1) nounwind, !dbg !3645 %3 = getelementptr inbounds i8, ptr @main, i32 %argc, !dbg !3746 %4 = trunc i32 %argc to i8, !dbg !3747 %5 = add i8 %4, 97, !dbg !3748 tail call void @llvm.dbg.value(metadata ptr %3, metadata !49, metadata !DIExpression()) nounwind, !dbg !3849 tail call void @llvm.dbg.value(metadata double %1, metadata !50, metadata !DIExpression()) nounwind, !dbg !3850 tail call void @llvm.dbg.value(metadata i8 %5, metadata !51, metadata !DIExpression()) nounwind, !dbg !3851 %6 = zext i8 %5 to i32, !dbg !3952 %7 = tail call i32 (ptr, ...) @printf(ptr @.str, ptr %3, double %1, i32 %6) nounwind, !dbg !3953 %8 = tail call i32 @printer(ptr %3, double %1, i8 zeroext %5) nounwind, !dbg !4054 ret i32 0, !dbg !4155}56 57declare i32 @puts(ptr nocapture) nounwind58 59!llvm.dbg.cu = !{!2}60!llvm.module.flags = !{!48}61 62!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, retainedNodes: !43)63!1 = !DIFile(filename: "a.c", directory: "/tmp/")64!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "(LLVM build 00)", isOptimized: true, emissionKind: FullDebug, file: !46, enums: !47, retainedTypes: !47, imports: null)65!3 = !DISubroutineType(types: !4)66!4 = !{!5, !6, !7, !8}67!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)68!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: null)69!7 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 32, encoding: DW_ATE_float)70!8 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)71!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, retainedNodes: !44)72!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, retainedNodes: !45)73!11 = !DISubroutineType(types: !12)74!12 = !{!5, !5, !13}75!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !14)76!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !46, scope: !1, baseType: !15)77!15 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)78!16 = !DILocalVariable(name: "ptr", line: 11, arg: 1, scope: !0, file: !1, type: !6)79!17 = !DILocalVariable(name: "val", line: 11, arg: 2, scope: !0, file: !1, type: !7)80!18 = !DILocalVariable(name: "c", line: 11, arg: 3, scope: !0, file: !1, type: !8)81!19 = !DILocalVariable(name: "ptr", line: 4, arg: 1, scope: !9, file: !1, type: !6)82!20 = !DILocalVariable(name: "val", line: 4, arg: 2, scope: !9, file: !1, type: !7)83!21 = !DILocalVariable(name: "c", line: 4, arg: 3, scope: !9, file: !1, type: !8)84 85!49 = !DILocalVariable(name: "ptr", line: 4, scope: !10, file: !1, type: !6)86!50 = !DILocalVariable(name: "val", line: 4, scope: !10, file: !1, type: !7)87!51 = !DILocalVariable(name: "c", line: 4, scope: !10, file: !1, type: !8)88 89!22 = !DILocalVariable(name: "argc", line: 17, arg: 1, scope: !10, file: !1, type: !5)90!23 = !DILocalVariable(name: "argv", line: 17, arg: 2, scope: !10, file: !1, type: !13)91!24 = !DILocalVariable(name: "dval", line: 19, scope: !25, file: !1, type: !7)92!25 = distinct !DILexicalBlock(line: 18, column: 0, file: !46, scope: !10)93!26 = !DILocation(line: 4, scope: !9)94!27 = !DILocation(line: 6, scope: !28)95!28 = distinct !DILexicalBlock(line: 5, column: 0, file: !46, scope: !9)96!29 = !DILocation(line: 7, scope: !28)97!30 = !DILocation(line: 11, scope: !0)98!31 = !DILocation(line: 13, scope: !32)99!32 = distinct !DILexicalBlock(line: 12, column: 0, file: !46, scope: !0)100!33 = !DILocation(line: 14, scope: !32)101!34 = !DILocation(line: 17, scope: !10)102!35 = !DILocation(line: 19, scope: !25)103!36 = !DILocation(line: 20, scope: !25)104!37 = !DILocation(line: 21, scope: !25)105!38 = !DILocation(line: 4, scope: !10, inlinedAt: !37)106!39 = !DILocation(line: 6, scope: !28, inlinedAt: !37)107!40 = !DILocation(line: 22, scope: !25)108!41 = !DILocation(line: 23, scope: !25)109!43 = !{!16, !17, !18}110!44 = !{!19, !20, !21}111!45 = !{!22, !23, !24}112!46 = !DIFile(filename: "a.c", directory: "/tmp/")113!47 = !{}114!48 = !{i32 1, !"Debug Info Version", i32 3}115