forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugMacroUndefinedUndef.ll
More file actions
91 lines (71 loc) · 3.6 KB
/
DebugMacroUndefinedUndef.ll
File metadata and controls
91 lines (71 loc) · 3.6 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
; This test exercises the cases where there is a DW_MACINFO_undef without a matching DW_MACINFO_def
; Test round-trip translation of debug macro information:
; LLVM IR -> SPIR-V -> LLVM IR
; RUN: llvm-spirv --spirv-debug-info-version=ocl-100 %s -o %t.spv
; RUN: spirv-val %t.spv
; RUN: %if spirv-dis %{ spirv-dis %t.spv -o - | FileCheck %s --check-prefix CHECK-SPIRV-OCL %}
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
; RUN: FileCheck %s --input-file %t.rev.ll
; RUN: llvm-spirv --spirv-ext=+SPV_KHR_non_semantic_info --spirv-debug-info-version=nonsemantic-shader-100 %s -o %t.spv
; RUN: spirv-val %t.spv
; RUN: %if spirv-dis %{ spirv-dis %t.spv -o - | FileCheck %s --check-prefix CHECK-SPIRV-NON-SEMANTIC-100 %}
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
; RUN: FileCheck %s --input-file %t.rev.ll
; RUN: llvm-spirv --spirv-ext=+SPV_KHR_non_semantic_info --spirv-debug-info-version=nonsemantic-shader-200 %s -o %t.spv
; RUN: spirv-val %t.spv
; RUN: %if spirv-dis %{ spirv-dis %t.spv -o - | FileCheck %s --check-prefix CHECK-SPIRV-NON-SEMANTIC-200 %}
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis %t.rev.bc -o %t.rev.ll
; RUN: FileCheck %s --input-file %t.rev.ll
; CHECK-NOT: !DIMacro(type: DW_MACINFO_undef, line: 1, {{.*}})
; CHECK-SPIRV-OCL-NOT: DebugMacroDef
; CHECK-SPIRV-OCL-DAG: %[[source_file:.*]] = OpString "./def.c"
; CHECK-SPIRV-OCL-DAG: %[[debug_none:.*]] = OpExtInst %void %[[#]] DebugInfoNone
; CHECK-SPIRV-OCL-DAG: %[[#]] = OpExtInst %void %[[#]] DebugMacroUndef %[[source_file]] 1 %[[debug_none]]
; CHECK-SPIRV-NON-SEMANTIC-100-NOT: DebugMacroDef
; CHECK-SPIRV-NON-SEMANTIC-100-DAG: %[[type:.*]] = OpTypeInt 32 0
; CHECK-SPIRV-NON-SEMANTIC-100-DAG: %[[uint_1_reg:.*]] = OpConstant %[[type]] 1
; CHECK-SPIRV-NON-SEMANTIC-100-DAG: %[[source_file:.*]] = OpString "./def.c"
; CHECK-SPIRV-NON-SEMANTIC-100-DAG: %[[debug_none:.*]] = OpExtInst %void %[[#]] DebugInfoNone
; CHECK-SPIRV-NON-SEMANTIC-100-DAG: %[[#]] = OpExtInst %void %[[#]] DebugMacroUndef %[[source_file]] %[[uint_1_reg]] %[[debug_none]]
; CHECK-SPIRV-NON-SEMANTIC-200-NOT: DebugMacroDef
; CHECK-SPIRV-NON-SEMANTIC-200-DAG: %[[type:.*]] = OpTypeInt 32 0
; CHECK-SPIRV-NON-SEMANTIC-200-DAG: %[[uint_1_reg:.*]] = OpConstant %[[type]] 1
; CHECK-SPIRV-NON-SEMANTIC-200-DAG: %[[source_file:.*]] = OpString "./def.c"
; CHECK-SPIRV-NON-SEMANTIC-200-DAG: %[[debug_none:.*]] = OpExtInst %void %[[#]] {{(0|DebugInfoNone)}}
; CHECK-SPIRV-NON-SEMANTIC-200-DAG: %[[#]] = OpExtInst %void %[[#]] {{(33|DebugMacroUndef)}} %[[source_file]] %[[uint_1_reg]] %[[debug_none]]
target triple = "spir64-unknown-unknown"
; Function Attrs: nounwind
define spir_func i32 @main() #0 {
entry:
ret i32 0
}
attributes #0 = { nounwind }
!llvm.module.flags = !{!0, !1, !12}
!llvm.dbg.cu = !{!4}
!spirv.MemoryModel = !{!13}
!opencl.enable.FP_CONTRACT = !{}
!spirv.Source = !{!14}
!opencl.spir.version = !{!15}
!opencl.used.extensions = !{!16}
!opencl.used.optional.core.features = !{!16}
!spirv.Generator = !{!17}
!0 = !{i32 7, !"Dwarf Version", i32 0}
!1 = !{i32 2, !"Source Lang Literal", !2}
!2 = !{!3}
!3 = !{!4, i32 12}
!4 = distinct !DICompileUnit(language: DW_LANG_OpenCL, file: !5, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, macros: !6)
!5 = !DIFile(filename: "def.c", directory: "/tmp")
!6 = !{!7}
!7 = !DIMacroFile(file: !8, nodes: !9)
!8 = !DIFile(filename: "def.c", directory: ".")
!9 = !{!11}
!11 = !DIMacro(type: DW_MACINFO_undef, line: 1, name: "SIZE")
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 2, i32 2}
!14 = !{i32 4, i32 100000}
!15 = !{i32 1, i32 2}
!16 = !{}
!17 = !{i16 7, i16 0}