|
5 | 5 |
|
6 | 6 | ; CHECK: include_directories[ 0] = "dir"
|
7 | 7 | ; CHECK-NEXT: file_names[ 0]:
|
| 8 | +; CHECK-NEXT: name: "main.c" |
| 9 | +; CHECK-NEXT: dir_index: 0 |
| 10 | +; CHECK-NOT: source: |
| 11 | +; CHECK-NEXT: file_names[ 1]: |
8 | 12 | ; CHECK-NEXT: name: "foo.c"
|
9 | 13 | ; CHECK-NEXT: dir_index: 0
|
10 | 14 | ; CHECK-NEXT: source: "void foo() { }\n"
|
11 |
| -; CHECK-NEXT: file_names[ 1]: |
12 |
| -; CHECK-NEXT: name: "bar.h" |
| 15 | +; CHECK-NEXT: file_names[ 2]: |
| 16 | +; CHECK-NEXT: name: "newline.h" |
| 17 | +; CHECK-NEXT: dir_index: 0 |
| 18 | +; CHECK-NEXT: source: "\n" |
| 19 | +; CHECK-NEXT: file_names[ 3]: |
| 20 | +; CHECK-NEXT: name: "empty.h" |
| 21 | +; CHECK-NEXT: dir_index: 0 |
| 22 | +; CHECK-NEXT: source: "\n" |
| 23 | +; CHECK-NEXT: file_names[ 4]: |
| 24 | +; CHECK-NEXT: name: "absent.h" |
13 | 25 | ; CHECK-NEXT: dir_index: 0
|
14 | 26 | ; CHECK-NOT: source:
|
15 | 27 |
|
16 | 28 | ; Test that DIFiles mixing source and no-source within a DICompileUnit works.
|
17 | 29 |
|
18 |
| -define dso_local void @foo() !dbg !5 { |
| 30 | +define dso_local void @foo() !dbg !6 { |
19 | 31 | ret void, !dbg !7
|
20 | 32 | }
|
21 | 33 |
|
22 |
| -define dso_local void @bar() !dbg !6 { |
23 |
| - ret void, !dbg !8 |
| 34 | +define dso_local void @newline() !dbg !9 { |
| 35 | + ret void, !dbg !10 |
24 | 36 | }
|
25 | 37 |
|
26 |
| -!llvm.dbg.cu = !{!4} |
| 38 | +define dso_local void @empty() !dbg !12 { |
| 39 | + ret void, !dbg !13 |
| 40 | +} |
| 41 | + |
| 42 | +define dso_local void @absent() !dbg !15 { |
| 43 | + ret void, !dbg !16 |
| 44 | +} |
| 45 | + |
| 46 | +!llvm.dbg.cu = !{!2} |
27 | 47 | !llvm.module.flags = !{!0, !1}
|
28 | 48 |
|
29 | 49 | !0 = !{i32 2, !"Dwarf Version", i32 5}
|
30 | 50 | !1 = !{i32 2, !"Debug Info Version", i32 3}
|
31 | 51 |
|
32 |
| -!2 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A") |
33 |
| -!3 = !DIFile(filename: "bar.h", directory: "dir") |
| 52 | +!2 = distinct !DICompileUnit(language: DW_LANG_C99, emissionKind: FullDebug, file: !4) |
| 53 | +!3 = !DISubroutineType(types: !{}) |
| 54 | +!4 = !DIFile(filename: "main.c", directory: "dir") |
| 55 | + |
| 56 | +!5 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A") |
| 57 | +!6 = distinct !DISubprogram(name: "foo", file: !5, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2) |
| 58 | +!7 = !DILocation(line: 1, scope: !6) |
| 59 | + |
| 60 | +!8 = !DIFile(filename: "newline.h", directory: "dir", source: "\0A") |
| 61 | +!9 = distinct !DISubprogram(name: "newline", file: !8, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2) |
| 62 | +!10 = !DILocation(line: 1, scope: !9) |
| 63 | + |
| 64 | +!11 = !DIFile(filename: "empty.h", directory: "dir", source: "") |
| 65 | +!12 = distinct !DISubprogram(name: "empty", file: !11, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2) |
| 66 | +!13 = !DILocation(line: 1, scope: !12) |
34 | 67 |
|
35 |
| -!4 = distinct !DICompileUnit(language: DW_LANG_C99, emissionKind: FullDebug, file: !2) |
36 |
| -!5 = distinct !DISubprogram(name: "foo", file: !2, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !4) |
37 |
| -!6 = distinct !DISubprogram(name: "bar", file: !3, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !4) |
38 |
| -!7 = !DILocation(line: 1, scope: !5) |
39 |
| -!8 = !DILocation(line: 1, scope: !6) |
40 |
| -!9 = !DISubroutineType(types: !{}) |
| 68 | +!14 = !DIFile(filename: "absent.h", directory: "dir") |
| 69 | +!15 = distinct !DISubprogram(name: "absent", file: !14, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2) |
| 70 | +!16 = !DILocation(line: 1, scope: !15) |
0 commit comments