1 ; REQUIRES: object-emission
3 ; RUN: %llc_dwarf -filetype=obj < %s > %t
4 ; RUN: llvm-dwarfdump %t | FileCheck %s
6 ; IR generated from clang -O -g with the following source
8 ; void f1(int x, int y);
13 ; void f1(int x, int y) {
17 ; CHECK: DW_AT_name{{.*}}"f1"
18 ; CHECK: DW_TAG_formal_parameter
20 ; CHECK: DW_AT_name{{.*}}"x"
21 ; CHECK: DW_TAG_formal_parameter
23 ; CHECK: DW_AT_name{{.*}}"y"
25 ; Function Attrs: uwtable
26 define void @_Z2f2v() #0 !dbg !4 {
27 tail call void @llvm.dbg.value(metadata i32 undef, metadata !16, metadata !DIExpression()), !dbg !18
28 tail call void @llvm.dbg.value(metadata i32 2, metadata !20, metadata !DIExpression()), !dbg !18
29 tail call void @_Z2f3i(i32 2), !dbg !21
33 ; Function Attrs: uwtable
34 define void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 {
35 tail call void @llvm.dbg.value(metadata i32 %x, metadata !13, metadata !DIExpression()), !dbg !23
36 tail call void @llvm.dbg.value(metadata i32 %y, metadata !14, metadata !DIExpression()), !dbg !23
37 tail call void @_Z2f3i(i32 %y), !dbg !24
41 declare void @_Z2f3i(i32) #1
43 ; Function Attrs: nounwind readnone
44 declare void @llvm.dbg.value(metadata, metadata, metadata) #2
46 attributes #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 attributes #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 attributes #2 = { nounwind readnone }
51 !llvm.module.flags = !{!26}
53 !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 !1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
56 !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, retainedNodes: !2)
57 !5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
58 !6 = !DISubroutineType(types: !7)
60 !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, retainedNodes: !12)
61 !9 = !DISubroutineType(types: !10)
62 !10 = !{null, !11, !11}
63 !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
65 !13 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11)
66 !14 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11)
68 !16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11)
69 !17 = !DILocation(line: 4, scope: !4)
70 !18 = !DILocation(line: 6, scope: !8, inlinedAt: !17)
72 !20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11)
73 !21 = !DILocation(line: 7, scope: !8, inlinedAt: !17)
74 !22 = !DILocation(line: 5, scope: !4)
75 !23 = !DILocation(line: 6, scope: !8)
76 !24 = !DILocation(line: 7, scope: !8)
77 !25 = !DILocation(line: 8, scope: !8)
78 !26 = !{i32 1, !"Debug Info Version", i32 3}