Jyotsna Verma | ddca5fa | 2013-07-02 19:21:43 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -filetype=obj < %s > %t |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 4 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 5 | |
| 6 | ; IR generated from clang -O -g with the following source |
| 7 | ; |
| 8 | ; void f1(int x, int y); |
| 9 | ; void f3(int line); |
| 10 | ; void f2() { |
| 11 | ; f1(1, 2); |
| 12 | ; } |
| 13 | ; void f1(int x, int y) { |
| 14 | ; f3(y); |
| 15 | ; } |
| 16 | |
| 17 | ; CHECK: DW_AT_name{{.*}}"f1" |
| 18 | ; CHECK: DW_TAG_formal_parameter |
David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 19 | ; CHECK-NOT: DW_TAG |
| 20 | ; CHECK: DW_AT_name{{.*}}"x" |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 21 | ; CHECK: DW_TAG_formal_parameter |
David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 22 | ; CHECK-NOT: DW_TAG |
| 23 | ; CHECK: DW_AT_name{{.*}}"y" |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 24 | |
| 25 | ; Function Attrs: uwtable |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 26 | define void @_Z2f2v() #0 !dbg !4 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 27 | tail call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !16, metadata !DIExpression()), !dbg !18 |
| 28 | tail call void @llvm.dbg.value(metadata i32 2, i64 0, metadata !20, metadata !DIExpression()), !dbg !18 |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 29 | tail call void @_Z2f3i(i32 2), !dbg !21 |
| 30 | ret void, !dbg !22 |
| 31 | } |
| 32 | |
| 33 | ; Function Attrs: uwtable |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 34 | define void @_Z2f1ii(i32 %x, i32 %y) #0 !dbg !8 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 35 | tail call void @llvm.dbg.value(metadata i32 %x, i64 0, metadata !13, metadata !DIExpression()), !dbg !23 |
| 36 | tail call void @llvm.dbg.value(metadata i32 %y, i64 0, metadata !14, metadata !DIExpression()), !dbg !23 |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 37 | tail call void @_Z2f3i(i32 %y), !dbg !24 |
| 38 | ret void, !dbg !25 |
| 39 | } |
| 40 | |
| 41 | declare void @_Z2f3i(i32) #1 |
| 42 | |
| 43 | ; Function Attrs: nounwind readnone |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 44 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 45 | |
Bill Wendling | 187d3dd | 2013-08-22 21:28:54 +0000 | [diff] [blame] | 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" } |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 48 | attributes #2 = { nounwind readnone } |
| 49 | |
| 50 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 51 | !llvm.module.flags = !{!26} |
David Blaikie | 6f1a806 | 2013-06-05 05:39:59 +0000 | [diff] [blame] | 52 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 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) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 54 | !1 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 55 | !2 = !{} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 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, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 57 | !5 = !DIFile(filename: "exp.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch") |
| 58 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 59 | !7 = !{null} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 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, variables: !12) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 61 | !9 = !DISubroutineType(types: !10) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 62 | !10 = !{null, !11, !11} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 63 | !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 64 | !12 = !{!13, !14} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 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) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 67 | !15 = !{i32 undef} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 68 | !16 = !DILocalVariable(name: "x", line: 6, arg: 1, scope: !8, file: !5, type: !11) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 69 | !17 = !DILocation(line: 4, scope: !4) |
| 70 | !18 = !DILocation(line: 6, scope: !8, inlinedAt: !17) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 71 | !19 = !{i32 2} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 72 | !20 = !DILocalVariable(name: "y", line: 6, arg: 2, scope: !8, file: !5, type: !11) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 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) |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 78 | !26 = !{i32 1, !"Debug Info Version", i32 3} |