Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/expr-opcode.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv --spirv-allow-extra-diexpressions
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.rev.ll
4 ; RUN: FileCheck %s --input-file %t.rev.ll
5
6 ; RUN: llc -mtriple=%triple -dwarf-version=5 -filetype=obj -O0 < %t.rev.ll
7 ; RUN: llc -mtriple=%triple -dwarf-version=4 -filetype=obj -O0 < %t.rev.ll
8
9 ; RUN: llvm-spirv %t.bc -o %t.spv --spirv-debug-info-version=nonsemantic-shader-200
10 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.rev.ll
11 ; RUN: FileCheck %s --input-file %t.rev.ll
12
13 ; RUN: llc -mtriple=%triple -dwarf-version=5 -filetype=obj -O0 < %t.rev.ll
14 ; RUN: llc -mtriple=%triple -dwarf-version=4 -filetype=obj -O0 < %t.rev.ll
15
16 ; CHECK: DW_OP_constu, 42
17 ; CHECK: DW_OP_plus_uconst, 42
18 ; CHECK: DW_OP_plus
19 ; CHECK: DW_OP_minus
20 ; CHECK: DW_OP_mul
21 ; CHECK: DW_OP_div
22 ; CHECK: DW_OP_mod
23 ; CHECK: DW_OP_or
24 ; CHECK: DW_OP_and
25 ; CHECK: DW_OP_xor
26 ; CHECK: DW_OP_shl
27 ; CHECK: DW_OP_shr
28 ; CHECK: DW_OP_shra
29 ; CHECK: DW_OP_deref
30 ; CHECK: DW_OP_deref_size, 4
31 ; CHECK: DW_OP_xderef
32 ; CHECK: DW_OP_lit0
33 ; CHECK: DW_OP_not
34 ; CHECK: DW_OP_dup
35 ; CHECK: DW_OP_regx, 1
36 ; CHECK: DW_OP_bregx, 1, 4
37 ; CHECK: DW_OP_push_object_address
38 ; CHECK: DW_OP_swap
39 ; CHECK: DW_OP_LLVM_convert, 8, DW_ATE_signed
40 ; CHECK: DW_OP_stack_value
41
42 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
43 target triple = "spir64-unknown-unknown"
44
45 ; Function Attrs: noinline nounwind uwtable
46 define dso_local signext i8 @foo(i8 signext %x) !dbg !7 {
47 entry:
48 call void @llvm.dbg.value(metadata i8 %x, metadata !11, metadata !DIExpression()), !dbg !12
49 call void @llvm.dbg.value(metadata i8 32, metadata !13, metadata !DIExpression(DW_OP_constu, 42, DW_OP_plus_uconst, 42, DW_OP_plus, DW_OP_minus, DW_OP_mul, DW_OP_div, DW_OP_mod, DW_OP_or, DW_OP_and, DW_OP_xor, DW_OP_shl, DW_OP_shr, DW_OP_shra, DW_OP_deref, DW_OP_deref_size, 4, DW_OP_xderef, DW_OP_lit0, DW_OP_not, DW_OP_dup, DW_OP_regx, 1, DW_OP_bregx, 1, 4, DW_OP_push_object_address, DW_OP_swap, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_stack_value)), !dbg !15
50 ret i8 %x, !dbg !16
51 }
52
53 ; Function Attrs: nounwind readnone speculatable
54 declare void @llvm.dbg.declare(metadata, metadata, metadata)
55
56 ; Function Attrs: nounwind readnone speculatable
57 declare void @llvm.dbg.value(metadata, metadata, metadata)
58
59 !llvm.dbg.cu = !{!0}
60 !llvm.module.flags = !{!3, !4, !5}
61 !llvm.ident = !{!6}
62
63 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 9.0.0 (trunk 353791) (llvm/trunk 353801)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
64 !1 = !DIFile(filename: "dbg.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "2a034da6937f5b9cf6dd2d89127f57fd")
65 !2 = !{}
66 !3 = !{i32 2, !"Dwarf Version", i32 5}
67 !4 = !{i32 2, !"Debug Info Version", i32 3}
68 !5 = !{i32 1, !"wchar_size", i32 4}
69 !6 = !{!"clang version 9.0.0 (trunk 353791) (llvm/trunk 353801)"}
70 !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
71 !8 = !DISubroutineType(types: !9)
72 !9 = !{!10, !10}
73 !10 = !DIBasicType(name: "signed char", size: 8, encoding: DW_ATE_signed_char)
74 !11 = !DILocalVariable(name: "x", arg: 1, scope: !7, file: !1, line: 1, type: !10)
75 !12 = !DILocation(line: 1, column: 29, scope: !7)
76 !13 = !DILocalVariable(name: "y", scope: !7, file: !1, line: 3, type: !14)
77 !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
78 !15 = !DILocation(line: 3, column: 14, scope: !7)
79 !16 = !DILocation(line: 4, column: 3, scope: !7)