Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 1 | ; Source text provided by IR should be passed through to asm. |
| 2 | ; It is emitted to an object file only for DWARF 5 or later. |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 3 | |
| 4 | ; REQUIRES: object-emission |
Paul Robinson | cc7344a | 2018-06-14 13:38:20 +0000 | [diff] [blame] | 5 | ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4 |
| 6 | ; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-5 |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 7 | ; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 8 | ; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefixes=OBJ,OBJ-4 |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 9 | ; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 10 | ; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5 |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 11 | |
Paul Robinson | cc7344a | 2018-06-14 13:38:20 +0000 | [diff] [blame] | 12 | ; ASM-4: .file 1 "/test{{.*[/\\]}}t1.h" source "11111111111111111111111111111111" |
| 13 | ; ASM-4: .file 2 "/test{{.*[/\\]}}t2.h" source "22222222222222222222222222222222" |
Paul Robinson | 407ff1b | 2018-03-29 18:59:33 +0000 | [diff] [blame] | 14 | ; ASM-5: .file 0 "/test{{.*[/\\]}}t.c" source "00000000000000000000000000000000" |
Paul Robinson | cc7344a | 2018-06-14 13:38:20 +0000 | [diff] [blame] | 15 | ; ASM-5: .file 1 "t1.h" source "11111111111111111111111111111111" |
| 16 | ; ASM-5: .file 2 "t2.h" source "22222222222222222222222222222222" |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 17 | |
| 18 | ; OBJ-5: file_names[ 0]: |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 19 | ; OBJ-5-NEXT: name: "t.c" |
| 20 | ; OBJ-5-NEXT: dir_index: 0 |
| 21 | ; OBJ-5-NEXT: source: "00000000000000000000000000000000" |
| 22 | ; OBJ: file_names[ 1]: |
| 23 | ; OBJ-NEXT: name: "t1.h" |
| 24 | ; OBJ-NEXT: dir_index: 0 |
| 25 | ; OBJ-4-NOT: 11111111111111111111111111111111 |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 26 | ; OBJ-5-NEXT: source: "11111111111111111111111111111111" |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 27 | ; OBJ: file_names[ 2]: |
| 28 | ; OBJ-NEXT: name: "t2.h" |
| 29 | ; OBJ-NEXT: dir_index: 0 |
| 30 | ; OBJ-4-NOT: 22222222222222222222222222222222 |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 31 | ; OBJ-5-NEXT: source: "22222222222222222222222222222222" |
| 32 | |
| 33 | ; ModuleID = 't.c' |
| 34 | source_filename = "t.c" |
| 35 | |
| 36 | @t1 = global i32 1, align 4, !dbg !0 |
| 37 | @t2 = global i32 0, align 4, !dbg !6 |
| 38 | |
| 39 | !llvm.dbg.cu = !{!2} |
| 40 | !llvm.module.flags = !{!11, !12, !13} |
| 41 | !llvm.ident = !{!14} |
| 42 | |
| 43 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 44 | !1 = distinct !DIGlobalVariable(name: "t1", scope: !2, file: !10, line: 1, type: !9, isLocal: false, isDefinition: true) |
| 45 | !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 322159)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 46 | !3 = !DIFile(filename: "t.c", directory: "/test", source: "00000000000000000000000000000000") |
| 47 | !4 = !{} |
| 48 | !5 = !{!0, !6} |
| 49 | !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) |
| 50 | !7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true) |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 51 | !8 = !DIFile(filename: "t2.h", directory: "/test", source: "22222222222222222222222222222222") |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 52 | !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
Paul Robinson | b271f31 | 2018-03-29 17:16:41 +0000 | [diff] [blame] | 53 | !10 = !DIFile(filename: "t1.h", directory: "/test", source: "11111111111111111111111111111111") |
Scott Linder | c16b975 | 2018-02-23 23:13:18 +0000 | [diff] [blame] | 54 | !11 = !{i32 2, !"Dwarf Version", i32 4} |
| 55 | !12 = !{i32 2, !"Debug Info Version", i32 3} |
| 56 | !13 = !{i32 1, !"wchar_size", i32 4} |
| 57 | !14 = !{!"clang version 7.0.0 (trunk 322159)"} |