| Manman Ren | ed696c3 | 2013-07-24 22:23:00 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-pc-linux-gnu %s -o %t -filetype=obj |
| Eli Bendersky | e6abe83 | 2013-01-25 21:44:53 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 3 | |
| 4 | ; ModuleID = 'test.c' |
| 5 | |
| Nick Lewycky | d59c0ca | 2011-10-27 06:44:11 +0000 | [diff] [blame] | 6 | @GLB = common global i32 0, align 4 |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 7 | |
| 8 | define i32 @f() nounwind { |
| Nick Lewycky | d59c0ca | 2011-10-27 06:44:11 +0000 | [diff] [blame] | 9 | %LOC = alloca i32, align 4 |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 10 | call void @llvm.dbg.declare(metadata i32* %LOC, metadata !15, metadata !{!"0x102"}), !dbg !17 |
| Nick Lewycky | d59c0ca | 2011-10-27 06:44:11 +0000 | [diff] [blame] | 11 | %1 = load i32* @GLB, align 4, !dbg !18 |
| 12 | store i32 %1, i32* %LOC, align 4, !dbg !18 |
| 13 | %2 = load i32* @GLB, align 4, !dbg !19 |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 14 | ret i32 %2, !dbg !19 |
| 15 | } |
| 16 | |
| Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 17 | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 18 | |
| 19 | !llvm.dbg.cu = !{!0} |
| Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 20 | !llvm.module.flags = !{!21} |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 21 | |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 22 | !0 = !{!"0x11\0012\00clang version 3.0 (trunk)\000\00\000\00\000", !20, !1, !1, !3, !12, !1} ; [ DW_TAG_compile_unit ] |
| 23 | !1 = !{} |
| 24 | !3 = !{!5} |
| 25 | !5 = !{!"0x2e\00f\00f\00\003\000\001\000\006\000\000\000", !6, !6, !7, null, i32 ()* @f, null, null, null} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 0] [f] |
| 26 | !6 = !{!"0x29", !20} ; [ DW_TAG_file_type ] |
| 27 | !7 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] |
| 28 | !8 = !{!9} |
| 29 | !9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] |
| 30 | !12 = !{!14} |
| 31 | !14 = !{!"0x34\00GLB\00GLB\00\001\000\001", null, !6, !9, i32* @GLB, null} ; [ DW_TAG_variable ] |
| 32 | !15 = !{!"0x100\00LOC\004\000", !16, !6, !9} ; [ DW_TAG_auto_variable ] |
| 33 | !16 = !{!"0xb\003\009\000", !20, !5} ; [ DW_TAG_lexical_block ] |
| Duncan P. N. Exon Smith | 9885469 | 2015-01-14 22:27:36 +0000 | [diff] [blame] | 34 | !17 = !MDLocation(line: 4, column: 9, scope: !16) |
| 35 | !18 = !MDLocation(line: 4, column: 23, scope: !16) |
| 36 | !19 = !MDLocation(line: 5, column: 5, scope: !16) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 37 | !20 = !{!"test.c", !"/work/llvm/vanilla/test/DebugInfo"} |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 38 | |
| Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 39 | ; CHECK: DW_TAG_variable |
| David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 40 | ; CHECK-NOT: DW_TAG |
| 41 | ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "GLB") |
| 42 | ; CHECK-NOT: DW_TAG |
| Frederic Riss | 220fa48 | 2014-09-22 16:17:32 +0000 | [diff] [blame] | 43 | ; CHECK: DW_AT_decl_file [DW_FORM_data1] ("/work/llvm/vanilla/test/DebugInfo{{[/\\]}}test.c") |
| David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 44 | ; CHECK-NOT: DW_TAG |
| Frederic Riss | 0982e69 | 2014-09-05 07:21:50 +0000 | [diff] [blame] | 45 | ; CHECK: DW_AT_decl_line [DW_FORM_data1] (1) |
| James Molloy | 0ceb8ca | 2011-09-26 17:40:42 +0000 | [diff] [blame] | 46 | |
| Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 47 | ; CHECK: DW_TAG_variable |
| David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 48 | ; CHECK-NOT: DW_TAG |
| 49 | ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "LOC") |
| 50 | ; CHECK-NOT: DW_TAG |
| Frederic Riss | 220fa48 | 2014-09-22 16:17:32 +0000 | [diff] [blame] | 51 | ; CHECK: DW_AT_decl_file [DW_FORM_data1] ("/work/llvm/vanilla/test/DebugInfo{{[/\\]}}test.c") |
| David Blaikie | 04ed1d1 | 2014-06-13 21:52:33 +0000 | [diff] [blame] | 52 | ; CHECK-NOT: DW_TAG |
| Frederic Riss | 0982e69 | 2014-09-05 07:21:50 +0000 | [diff] [blame] | 53 | ; CHECK: DW_AT_decl_line [DW_FORM_data1] (4) |
| Eric Christopher | d6152aa | 2012-12-27 02:13:55 +0000 | [diff] [blame] | 54 | |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 55 | !21 = !{i32 1, !"Debug Info Version", i32 2} |