Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 1 | ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s |
| 2 | |
| 3 | ; Produced from linking: |
| 4 | ; /tmp/test1.c containing f() |
| 5 | ; /tmp/test2.c containing g() |
| 6 | |
| 7 | ; Verify that both compile units and both their contained functions are |
| 8 | ; listed by DebugInfoFinder: |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 9 | ;CHECK: Compile unit: DW_LANG_C99 from /tmp/test1.c |
| 10 | ;CHECK: Compile unit: DW_LANG_C99 from /tmp/test2.c |
| 11 | ;CHECK: Subprogram: f from /tmp/test1.c:1 |
| 12 | ;CHECK: Subprogram: g from /tmp/test2.c:1 |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 13 | |
| 14 | define void @f() { |
| 15 | ret void, !dbg !14 |
| 16 | } |
| 17 | |
| 18 | define void @g() { |
| 19 | ret void, !dbg !15 |
| 20 | } |
| 21 | |
| 22 | !llvm.dbg.cu = !{!0, !8} |
| 23 | !llvm.module.flags = !{!13, !16} |
| 24 | |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 25 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 26 | !1 = !DIFile(filename: "test1.c", directory: "/tmp") |
Duncan P. N. Exon Smith | 988a7f8 | 2015-03-27 20:46:33 +0000 | [diff] [blame] | 27 | !2 = !{} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 28 | !3 = !{!4} |
Duncan P. N. Exon Smith | 814b8e9 | 2015-08-28 20:26:49 +0000 | [diff] [blame] | 29 | !4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void ()* @f, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 30 | !5 = !DIFile(filename: "test1.c", directory: "/tmp") |
| 31 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 32 | !7 = !{null} |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 33 | !8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: 0, file: !9, enums: !2, retainedTypes: !2, subprograms: !10, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 34 | !9 = !DIFile(filename: "test2.c", directory: "/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 35 | !10 = !{!11} |
Duncan P. N. Exon Smith | 814b8e9 | 2015-08-28 20:26:49 +0000 | [diff] [blame] | 36 | !11 = distinct !DISubprogram(name: "g", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 1, file: !9, scope: !12, type: !6, function: void ()* @g, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 37 | !12 = !DIFile(filename: "test2.c", directory: "/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 38 | !13 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 39 | !14 = !DILocation(line: 1, scope: !4) |
| 40 | !15 = !DILocation(line: 1, scope: !11) |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 41 | !16 = !{i32 1, !"Debug Info Version", i32 3} |