-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSourceInfo-Strip.ll
More file actions
56 lines (47 loc) · 2.42 KB
/
SourceInfo-Strip.ll
File metadata and controls
56 lines (47 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
; Compare source info emission with and without --dx-source-in-debug-module flag.
; RUN: llc %s --filetype=obj -o %t.dxbc
; RUN: llvm-objcopy --dump-section=DXIL=%t.dxil.bc %t.dxbc
; RUN: llvm-dis %t.dxil.bc -o - | FileCheck %s --check-prefix=ILDB-DIS
; RUN: llc %s --filetype=obj -o %t.dxbc --dx-source-in-debug-module
; RUN: llvm-objcopy --dump-section=DXIL=%t.dxil.bc %t.dxbc
; RUN: llvm-dis %t.dxil.bc -o - | FileCheck %s --check-prefix=ILDB-SOURCE-DIS
; Without the flag, dx.source should be replaced with dummy metadata.
; ILDB-DIS: !dx.source.contents = !{![[CONTENTS:[0-9]+]]}
; ILDB-DIS: !dx.source.defines = !{![[EMPTY_ARR:[0-9]+]]}
; ILDB-DIS: !dx.source.mainFileName = !{![[MAIN:[0-9]+]]}
; ILDB-DIS: !dx.source.args = !{![[EMPTY_ARR]]}
; ILDB-DIS: ![[CONTENTS]] = !{!"", !""}
; ILDB-DIS: ![[EMPTY_ARR]] = !{}
; ILDB-DIS: ![[MAIN]] = !{!""}
; With the flag, dx.source should be be preserved.
; ILDB-SOURCE-DIS: !dx.source.args = !{![[ARGS:[0-9]+]]}
; ILDB-SOURCE-DIS: !dx.source.contents = !{![[FILE1:[0-9]+]], ![[FILE2:[0-9]+]], ![[FILE3:[0-9]+]]}
; ILDB-SOURCE-DIS: !dx.source.mainFileName = !{![[MAIN:[0-9]+]]}
; ILDB-SOURCE-DIS: !dx.source.defines = !{![[DEFINES:[0-9]+]]}
; ILDB-SOURCE-DIS: ![[FILE1]] = !{!"C:\\dx-source-metadata.hlsl",
; ILDB-SOURCE-DIS: ![[FILE2]] = !{!"C:\\a.hlsl"
; ILDB-SOURCE-DIS: ![[FILE3]] = !{!"C:\\b.hlsl"
; ILDB-SOURCE-DIS: ![[MAIN]] = !{!"C:\\dx-source-metadata.hlsl"}
; ILDB-SOURCE-DIS: ![[DEFINES]] = !{!"USER_DEF0=42", !"USER_DEF1=43"}
target triple = "dxilv1.3-pc-shadermodel6.3-library"
define float @_Z3fooff(float %a, float %b) {
entry:
%add = fadd float %a, %b
ret float %add
}
!llvm.dbg.cu = !{!4}
!llvm.module.flags = !{!6, !7}
!dx.source.args = !{!0}
!dx.source.contents = !{!1, !2, !3}
!dx.source.mainFileName = !{!8}
!dx.source.defines = !{!9}
!0 = !{!"-g", !"-Tlib_6_3", !"-DUSER_DEF0=42", !"-DUSER_DEF1=43", !"C:\\\\dx-source-metadata.hlsl"}
!1 = !{!"C:\\dx-source-metadata.hlsl", !"#include \22a.hlsl\22\0A#include \22b.hlsl\22\0A\0Afloat foo(float a, float b) {\0A return a + b;\0A}\0A"}
!2 = !{!"C:\\a.hlsl", !"#include \22b.hlsl\22\0A"}
!3 = !{!"C:\\b.hlsl", !"#include <c.hlsl>\0A"}
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, emissionKind: FullDebug)
!5 = !DIFile(filename: "dx-source-metadata.hlsl", directory: "C:\\")
!6 = !{i32 2, !"Dwarf Version", i32 4}
!7 = !{i32 2, !"Debug Info Version", i32 3}
!8 = !{!"C:\\dx-source-metadata.hlsl"}
!9 = !{!"USER_DEF0=42", !"USER_DEF1=43"}