Eric Christopher | 7790cf8 | 2014-03-26 23:10:28 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj %s -o %t |
Eli Bendersky | e6abe83 | 2013-01-25 21:44:53 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -debug-dump=line %t | FileCheck %s |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 3 | |
Eric Christopher | aec8a82 | 2012-04-05 20:39:05 +0000 | [diff] [blame] | 4 | ; Check that the line table starts at 7, not 4, but that the first |
| 5 | ; statement isn't until line 8. |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 6 | |
Diego Novillo | 5b5cf50 | 2014-02-14 19:27:53 +0000 | [diff] [blame] | 7 | ; CHECK-NOT: 0x0000000000000000 7 0 1 0 0 is_stmt |
Eric Christopher | aec8a82 | 2012-04-05 20:39:05 +0000 | [diff] [blame] | 8 | ; CHECK: 0x0000000000000000 7 0 1 0 |
Diego Novillo | 5b5cf50 | 2014-02-14 19:27:53 +0000 | [diff] [blame] | 9 | ; CHECK: 0x0000000000000004 8 18 1 0 0 is_stmt prologue_end |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 10 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 11 | define i32 @callee(i32 %x) nounwind uwtable ssp !dbg !5 { |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 12 | entry: |
| 13 | %x.addr = alloca i32, align 4 |
| 14 | %y = alloca i32, align 4 |
| 15 | store i32 %x, i32* %x.addr, align 4 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 16 | call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !DIExpression()), !dbg !13 |
| 17 | call void @llvm.dbg.declare(metadata i32* %y, metadata !14, metadata !DIExpression()), !dbg !16 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 18 | %0 = load i32, i32* %x.addr, align 4, !dbg !17 |
| 19 | %1 = load i32, i32* %x.addr, align 4, !dbg !17 |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 20 | %mul = mul nsw i32 %0, %1, !dbg !17 |
| 21 | store i32 %mul, i32* %y, align 4, !dbg !17 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 22 | %2 = load i32, i32* %y, align 4, !dbg !18 |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 23 | %sub = sub nsw i32 %2, 2, !dbg !18 |
| 24 | ret i32 %sub, !dbg !18 |
| 25 | } |
| 26 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 27 | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 28 | |
| 29 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 30 | !llvm.module.flags = !{!20} |
Eric Christopher | b81e2b4 | 2012-04-03 17:55:42 +0000 | [diff] [blame] | 31 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 32 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.1 (trunk 153921) (llvm/trunk 153916)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !1, retainedTypes: !1, globals: !1, imports: !1) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 33 | !1 = !{} |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 34 | !5 = distinct !DISubprogram(name: "callee", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 7, file: !19, scope: !6, type: !7) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 35 | !6 = !DIFile(filename: "ending-run.c", directory: "/Users/echristo/tmp") |
| 36 | !7 = !DISubroutineType(types: !8) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 37 | !8 = !{!9, !9} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 38 | !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 39 | !12 = !DILocalVariable(name: "x", line: 5, arg: 1, scope: !5, file: !6, type: !9) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 40 | !13 = !DILocation(line: 5, column: 5, scope: !5) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 41 | !14 = !DILocalVariable(name: "y", line: 8, scope: !15, file: !6, type: !9) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 42 | !15 = distinct !DILexicalBlock(line: 7, column: 1, file: !19, scope: !5) |
| 43 | !16 = !DILocation(line: 8, column: 9, scope: !15) |
| 44 | !17 = !DILocation(line: 8, column: 18, scope: !15) |
| 45 | !18 = !DILocation(line: 9, column: 5, scope: !15) |
| 46 | !19 = !DIFile(filename: "ending-run.c", directory: "/Users/echristo/tmp") |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 47 | !20 = !{i32 1, !"Debug Info Version", i32 3} |