1*9880d681SAndroid Build Coastguard Worker; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -filetype=obj %s -regalloc=basic -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s 3*9880d681SAndroid Build Coastguard Workertarget 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" 4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-darwin10.0.0" 5*9880d681SAndroid Build Coastguard Worker; Test that the type for the formal parameter "var" makes it into the debug info. 6*9880d681SAndroid Build Coastguard Worker; rdar://8950491 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker;CHECK: DW_TAG_formal_parameter 9*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: DW_AT_location 10*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: DW_AT_name {{.*}} "var" 11*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: DW_AT_decl_file 12*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: DW_AT_decl_line 13*9880d681SAndroid Build Coastguard Worker;CHECK-NEXT: DW_AT_type 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker@dfm = external global i32, align 4 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Workerdefine i32 @foo(i32 %dev, i64 %cmd, i8* %data, i32 %data2) nounwind optsize ssp !dbg !0 { 20*9880d681SAndroid Build Coastguard Workerentry: 21*9880d681SAndroid Build Coastguard Worker call void @llvm.dbg.value(metadata i32 %dev, i64 0, metadata !12, metadata !DIExpression()), !dbg !13 22*9880d681SAndroid Build Coastguard Worker %tmp.i = load i32, i32* @dfm, align 4, !dbg !14 23*9880d681SAndroid Build Coastguard Worker %cmp.i = icmp eq i32 %tmp.i, 0, !dbg !14 24*9880d681SAndroid Build Coastguard Worker br i1 %cmp.i, label %if.else, label %if.end.i, !dbg !14 25*9880d681SAndroid Build Coastguard Worker 26*9880d681SAndroid Build Coastguard Workerif.end.i: ; preds = %entry 27*9880d681SAndroid Build Coastguard Worker switch i64 %cmd, label %if.then [ 28*9880d681SAndroid Build Coastguard Worker i64 2147772420, label %bb.i 29*9880d681SAndroid Build Coastguard Worker i64 536897538, label %bb116.i 30*9880d681SAndroid Build Coastguard Worker ], !dbg !22 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Workerbb.i: ; preds = %if.end.i 33*9880d681SAndroid Build Coastguard Worker unreachable 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Workerbb116.i: ; preds = %if.end.i 36*9880d681SAndroid Build Coastguard Worker unreachable 37*9880d681SAndroid Build Coastguard Worker 38*9880d681SAndroid Build Coastguard Workerif.then: ; preds = %if.end.i 39*9880d681SAndroid Build Coastguard Worker ret i32 undef, !dbg !23 40*9880d681SAndroid Build Coastguard Worker 41*9880d681SAndroid Build Coastguard Workerif.else: ; preds = %entry 42*9880d681SAndroid Build Coastguard Worker ret i32 0 43*9880d681SAndroid Build Coastguard Worker} 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Workerdeclare hidden fastcc i32 @bar(i32, i32* nocapture) nounwind optsize ssp 46*9880d681SAndroid Build Coastguard Workerdeclare hidden fastcc i32 @bar2(i32) nounwind optsize ssp 47*9880d681SAndroid Build Coastguard Workerdeclare hidden fastcc i32 @bar3(i32) nounwind optsize ssp 48*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!2} 51*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!29} 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Worker!0 = distinct !DISubprogram(name: "foo", line: 19510, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, scopeLine: 19510, file: !26, scope: !1, type: !3) 54*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "/tmp/f.c", directory: "/tmp") 55*9880d681SAndroid Build Coastguard Worker!2 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 2.9 (trunk 124753)", isOptimized: true, emissionKind: FullDebug, file: !27, enums: !28, retainedTypes: !28, imports: null) 56*9880d681SAndroid Build Coastguard Worker!3 = !DISubroutineType(types: !4) 57*9880d681SAndroid Build Coastguard Worker!4 = !{!5} 58*9880d681SAndroid Build Coastguard Worker!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 59*9880d681SAndroid Build Coastguard Worker!6 = distinct !DISubprogram(name: "bar3", line: 14827, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3) 60*9880d681SAndroid Build Coastguard Worker!7 = distinct !DISubprogram(name: "bar2", line: 15397, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3) 61*9880d681SAndroid Build Coastguard Worker!8 = distinct !DISubprogram(name: "bar", line: 12382, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !9) 62*9880d681SAndroid Build Coastguard Worker!9 = !DISubroutineType(types: !10) 63*9880d681SAndroid Build Coastguard Worker!10 = !{!11} 64*9880d681SAndroid Build Coastguard Worker!11 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) 65*9880d681SAndroid Build Coastguard Worker!12 = !DILocalVariable(name: "var", line: 19509, arg: 1, scope: !0, file: !1, type: !5) 66*9880d681SAndroid Build Coastguard Worker!13 = !DILocation(line: 19509, column: 20, scope: !0) 67*9880d681SAndroid Build Coastguard Worker!14 = !DILocation(line: 18091, column: 2, scope: !15, inlinedAt: !17) 68*9880d681SAndroid Build Coastguard Worker!15 = distinct !DILexicalBlock(line: 18086, column: 1, file: !26, scope: !16) 69*9880d681SAndroid Build Coastguard Worker!16 = distinct !DISubprogram(name: "foo_bar", line: 18086, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !2, file: !26, scope: !1, type: !3) 70*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 19514, column: 2, scope: !18) 71*9880d681SAndroid Build Coastguard Worker!18 = distinct !DILexicalBlock(line: 19510, column: 1, file: !26, scope: !0) 72*9880d681SAndroid Build Coastguard Worker!22 = !DILocation(line: 18094, column: 2, scope: !15, inlinedAt: !17) 73*9880d681SAndroid Build Coastguard Worker!23 = !DILocation(line: 19524, column: 1, scope: !18) 74*9880d681SAndroid Build Coastguard Worker!25 = !DIFile(filename: "f.i", directory: "/tmp") 75*9880d681SAndroid Build Coastguard Worker!26 = !DIFile(filename: "/tmp/f.c", directory: "/tmp") 76*9880d681SAndroid Build Coastguard Worker!27 = !DIFile(filename: "f.i", directory: "/tmp") 77*9880d681SAndroid Build Coastguard Worker!28 = !{} 78*9880d681SAndroid Build Coastguard Worker!29 = !{i32 1, !"Debug Info Version", i32 3} 79