1*9880d681SAndroid Build Coastguard Worker; REQUIRES: object-emission 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; RUN: %llc_dwarf -filetype=obj < %s > %t 4*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dwarfdump %t | FileCheck %s 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker; IR generated from clang -O -g with the following source 7*9880d681SAndroid Build Coastguard Worker; 8*9880d681SAndroid Build Coastguard Worker; void f1(int x, int y); 9*9880d681SAndroid Build Coastguard Worker; void f3(int line); 10*9880d681SAndroid Build Coastguard Worker; void f2() { 11*9880d681SAndroid Build Coastguard Worker; f1(1, 2); 12*9880d681SAndroid Build Coastguard Worker; } 13*9880d681SAndroid Build Coastguard Worker; void f1(int x, int y) { 14*9880d681SAndroid Build Coastguard Worker; f3(y); 15*9880d681SAndroid Build Coastguard Worker; } 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name{{.*}}"f1" 18*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter 19*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: DW_TAG 20*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name{{.*}}"x" 21*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter 22*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: DW_TAG 23*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name{{.*}}"y" 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker; Function Attrs: uwtable 26*9880d681SAndroid Build Coastguard Workerdefine void @_Z2f2v() #0 !dbg !4 { 27*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !16, metadata !DIExpression()), !dbg !18 28*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i32 2, i64 0, metadata !20, metadata !DIExpression()), !dbg !18 29*9880d681SAndroid Build Coastguard Worker tail call void @_Z2f3i(i32 2), !dbg !21 30*9880d681SAndroid Build Coastguard Worker ret void, !dbg !22 31*9880d681SAndroid Build Coastguard Worker} 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Worker; Function Attrs: uwtable 34*9880d681SAndroid Build Coastguard Workerdefine void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 { 35*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !13, metadata !DIExpression()), !dbg !23 36*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !14, metadata !DIExpression()), !dbg !23 37*9880d681SAndroid Build Coastguard Worker tail call void @_Z2f3i(i32 %y), !dbg !24 38*9880d681SAndroid Build Coastguard Worker ret void, !dbg !25 39*9880d681SAndroid Build Coastguard Worker} 40*9880d681SAndroid Build Coastguard Worker 41*9880d681SAndroid Build Coastguard Workerdeclare void @_Z2f3i(i32) #1 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone 44*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 45*9880d681SAndroid Build Coastguard Worker 46*9880d681SAndroid Build Coastguard Workerattributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 47*9880d681SAndroid Build Coastguard Workerattributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 48*9880d681SAndroid Build Coastguard Workerattributes #2 = { nounwind readnone } 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0} 51*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!26} 52*9880d681SAndroid Build Coastguard Worker 53*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2) 54*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") 55*9880d681SAndroid Build Coastguard Worker!2 = !{} 56*9880d681SAndroid Build Coastguard Worker!4 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2) 57*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") 58*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !7) 59*9880d681SAndroid Build Coastguard Worker!7 = !{null} 60*9880d681SAndroid Build Coastguard Worker!8 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1ii", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !9, variables: !12) 61*9880d681SAndroid Build Coastguard Worker!9 = !DISubroutineType(types: !10) 62*9880d681SAndroid Build Coastguard Worker!10 = !{null, !11, !11} 63*9880d681SAndroid Build Coastguard Worker!11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 64*9880d681SAndroid Build Coastguard Worker!12 = !{!13, !14} 65*9880d681SAndroid Build Coastguard Worker!13 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) 66*9880d681SAndroid Build Coastguard Worker!14 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) 67*9880d681SAndroid Build Coastguard Worker!15 = !{i32 undef} 68*9880d681SAndroid Build Coastguard Worker!16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) 69*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 4, scope: !4) 70*9880d681SAndroid Build Coastguard Worker!18 = !DILocation(line: 6, scope: !8, inlinedAt: !17) 71*9880d681SAndroid Build Coastguard Worker!19 = !{i32 2} 72*9880d681SAndroid Build Coastguard Worker!20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) 73*9880d681SAndroid Build Coastguard Worker!21 = !DILocation(line: 7, scope: !8, inlinedAt: !17) 74*9880d681SAndroid Build Coastguard Worker!22 = !DILocation(line: 5, scope: !4) 75*9880d681SAndroid Build Coastguard Worker!23 = !DILocation(line: 6, scope: !8) 76*9880d681SAndroid Build Coastguard Worker!24 = !DILocation(line: 7, scope: !8) 77*9880d681SAndroid Build Coastguard Worker!25 = !DILocation(line: 8, scope: !8) 78*9880d681SAndroid Build Coastguard Worker!26 = !{i32 1, !"Debug Info Version", i32 3} 79