Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 1 | ; MD5 checksums provided by IR should be passed through to asm. |
| 2 | ; They'll be emitted to an object file only for DWARF 5 or later. |
| 3 | |
Paul Robinson | b22d170 | 2018-01-13 01:39:30 +0000 | [diff] [blame] | 4 | ; Darwin clamps the line table at DWARF v2 so XFAIL this test. |
| 5 | ; XFAIL: darwin |
| 6 | |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 7 | ; REQUIRES: object-emission |
| 8 | ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM |
| 9 | ; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM |
| 10 | ; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 11 | ; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ-4 |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 12 | ; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 13 | ; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefix=OBJ-5 |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 14 | |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 15 | ; FIXME: Need to convey the MD5 for the primary source file. |
| 16 | ; ASM: .file 1 ".{{/|\\\\}}t1.h" md5 "11111111111111111111111111111111" |
| 17 | ; ASM: .file 2 ".{{/|\\\\}}t2.h" md5 "22222222222222222222222222222222" |
| 18 | |
| 19 | ; OBJ-4: file_names[ 1]: |
| 20 | ; OBJ-4-NEXT: name: "t1.h" |
| 21 | ; OBJ-4-NEXT: dir_index: 1 |
| 22 | ; OBJ-4: file_names[ 2]: |
| 23 | ; OBJ-4-NEXT: name: "t2.h" |
| 24 | ; OBJ-4-NEXT: dir_index: 1 |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 25 | |
Scott Linder | 16c7bda | 2018-02-23 23:01:06 +0000 | [diff] [blame] | 26 | ; OBJ-5: file_names[ 0]: |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 27 | ; OBJ-5-NEXT: name: "t1.h" |
| 28 | ; OBJ-5-NEXT: dir_index: 1 |
Scott Linder | 16c7bda | 2018-02-23 23:01:06 +0000 | [diff] [blame] | 29 | ; OBJ-5-NEXT: md5_checksum: 11111111111111111111111111111111 |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 30 | ; OBJ-5: file_names[ 1]: |
| 31 | ; OBJ-5-NEXT: name: "t2.h" |
| 32 | ; OBJ-5-NEXT: dir_index: 1 |
Scott Linder | 16c7bda | 2018-02-23 23:01:06 +0000 | [diff] [blame] | 33 | ; OBJ-5-NEXT: md5_checksum: 22222222222222222222222222222222 |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 34 | |
| 35 | ; ModuleID = 't.c' |
| 36 | source_filename = "t.c" |
| 37 | |
| 38 | @t1 = global i32 1, align 4, !dbg !0 |
| 39 | @t2 = global i32 0, align 4, !dbg !6 |
| 40 | |
| 41 | !llvm.dbg.cu = !{!2} |
| 42 | !llvm.module.flags = !{!11, !12, !13} |
| 43 | !llvm.ident = !{!14} |
| 44 | |
| 45 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 46 | !1 = distinct !DIGlobalVariable(name: "t1", scope: !2, file: !10, line: 1, type: !9, isLocal: false, isDefinition: true) |
| 47 | !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) |
| 48 | !3 = !DIFile(filename: "t.c", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "00000000000000000000000000000000") |
| 49 | !4 = !{} |
| 50 | !5 = !{!0, !6} |
| 51 | !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) |
| 52 | !7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true) |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 53 | !8 = !DIFile(filename: "./t2.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "22222222222222222222222222222222") |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 54 | !9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
Alexander Kornienko | e12a48b | 2018-03-07 16:27:44 +0000 | [diff] [blame] | 55 | !10 = !DIFile(filename: "./t1.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "11111111111111111111111111111111") |
Paul Robinson | 612e89d | 2018-01-12 19:17:50 +0000 | [diff] [blame] | 56 | !11 = !{i32 2, !"Dwarf Version", i32 4} |
| 57 | !12 = !{i32 2, !"Debug Info Version", i32 3} |
| 58 | !13 = !{i32 1, !"wchar_size", i32 4} |
| 59 | !14 = !{!"clang version 7.0.0 (trunk 322159)"} |