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
4; REQUIRES: object-emission
5; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
6; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -dwarf-directory=0 < %s | FileCheck %s --check-prefix=ASM-4-GAS
7; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-5
8; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s
9; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ
10; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s
11; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5
12
13; ASM-4-GAS: .file 1 "/scratch{{/|\\\\}}t1.h"
14; ASM-4-GAS: .file 2 "/scratch{{/|\\\\}}t2.h"
15
16; ASM-4-NOT: .file 0
17; ASM-4: .file 1 "/scratch" "t1.h"
18; ASM-4-NOT:  md5
19; ASM-4: .file 2 "/scratch" "t2.h"
20; ASM-4-NOT:  md5
21; ASM-5: .file 0 "/scratch" "t.c" md5 0x00000000000000000000000000000000
22; ASM-5: .file 1 "t1.h" md5 0x11111111111111111111111111111111
23; ASM-5: .file 2 "t2.h" md5 0x22222222222222222222222222222222
24
25; OBJ-5: file_names[ 0]:
26; OBJ-5-NEXT: name: "t.c"
27; OBJ-5-NEXT: dir_index: 0
28; OBJ-5-NEXT: md5_checksum: 00000000000000000000000000000000
29; OBJ: file_names[ 1]:
30; OBJ-NEXT: name: "t1.h"
31; OBJ-NEXT: dir_index: 0
32; OBJ-5-NEXT: md5_checksum: 11111111111111111111111111111111
33; OBJ: file_names[ 2]:
34; OBJ-NEXT: name: "t2.h"
35; OBJ-NEXT: dir_index: 0
36; OBJ-5-NEXT: md5_checksum: 22222222222222222222222222222222
37
38; ModuleID = 't.c'
39source_filename = "t.c"
40
41@t1 = global i32 1, align 4, !dbg !0
42@t2 = global i32 0, align 4, !dbg !6
43
44!llvm.dbg.cu = !{!2}
45!llvm.module.flags = !{!11, !12, !13}
46!llvm.ident = !{!14}
47
48!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
49!1 = distinct !DIGlobalVariable(name: "t1", scope: !2, file: !10, line: 1, type: !9, isLocal: false, isDefinition: true)
50!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)
51!3 = !DIFile(filename: "t.c", directory: "/scratch", checksumkind: CSK_MD5, checksum: "00000000000000000000000000000000")
52!4 = !{}
53!5 = !{!0, !6}
54!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
55!7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true)
56!8 = !DIFile(filename: "t2.h", directory: "/scratch", checksumkind: CSK_MD5, checksum: "22222222222222222222222222222222")
57!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58!10 = !DIFile(filename: "t1.h", directory: "/scratch", checksumkind: CSK_MD5, checksum: "11111111111111111111111111111111")
59!11 = !{i32 2, !"Dwarf Version", i32 4}
60!12 = !{i32 2, !"Debug Info Version", i32 3}
61!13 = !{i32 1, !"wchar_size", i32 4}
62!14 = !{!"clang version 7.0.0 (trunk 322159)"}
63