David Blaikie | 6a439ad | 2013-12-04 18:40:29 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
Devang Patel | 1a0df9a | 2010-05-10 22:49:55 +0000 | [diff] [blame] | 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
Jakob Stoklund Olesen | f28cc03 | 2010-10-15 16:06:42 +0000 | [diff] [blame] | 4 | |
David Blaikie | 6a439ad | 2013-12-04 18:40:29 +0000 | [diff] [blame] | 5 | ; Check that two compile units are generated |
Jakob Stoklund Olesen | f28cc03 | 2010-10-15 16:06:42 +0000 | [diff] [blame] | 6 | |
David Blaikie | 6a439ad | 2013-12-04 18:40:29 +0000 | [diff] [blame] | 7 | ; CHECK: Compile Unit: |
| 8 | ; CHECK: Compile Unit: |
Jakob Stoklund Olesen | f28cc03 | 2010-10-15 16:06:42 +0000 | [diff] [blame] | 9 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame^] | 10 | define i32 @foo() nounwind readnone ssp !dbg !2 { |
Devang Patel | 1a0df9a | 2010-05-10 22:49:55 +0000 | [diff] [blame] | 11 | return: |
| 12 | ret i32 42, !dbg !0 |
| 13 | } |
| 14 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame^] | 15 | define i32 @bar() nounwind readnone ssp !dbg !10 { |
Devang Patel | 1a0df9a | 2010-05-10 22:49:55 +0000 | [diff] [blame] | 16 | return: |
| 17 | ret i32 21, !dbg !8 |
| 18 | } |
| 19 | |
David Blaikie | e5a2f70 | 2013-03-08 00:23:31 +0000 | [diff] [blame] | 20 | !llvm.dbg.cu = !{!4, !12} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 21 | !llvm.module.flags = !{!21} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 22 | !16 = !{!2} |
| 23 | !17 = !{!10} |
David Blaikie | e5a2f70 | 2013-03-08 00:23:31 +0000 | [diff] [blame] | 24 | |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 25 | !0 = !DILocation(line: 3, scope: !1) |
| 26 | !1 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !2) |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame^] | 27 | !2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 28 | !3 = !DIFile(filename: "a.c", directory: "/tmp/") |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 29 | !4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 30 | !5 = !DISubroutineType(types: !6) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 31 | !6 = !{!7} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 32 | !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 33 | !8 = !DILocation(line: 3, scope: !9) |
| 34 | !9 = distinct !DILexicalBlock(line: 2, column: 0, file: !20, scope: !10) |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame^] | 35 | !10 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 36 | !11 = !DIFile(filename: "b.c", directory: "/tmp/") |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 37 | !12 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 38 | !13 = !DISubroutineType(types: !14) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 39 | !14 = !{!15} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 40 | !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 41 | !18 = !DIFile(filename: "a.c", directory: "/tmp/") |
Duncan P. N. Exon Smith | 988a7f8 | 2015-03-27 20:46:33 +0000 | [diff] [blame] | 42 | !19 = !{} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 43 | !20 = !DIFile(filename: "b.c", directory: "/tmp/") |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 44 | !21 = !{i32 1, !"Debug Info Version", i32 3} |