Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/dbg-value-frame-index.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
4
5 ; RUN: llc -mtriple=x86_64-unknown-unknown -o - %t.ll | FileCheck %s
6 ; RUN: llc -mtriple=x86_64-unknown-unknown -filetype=obj < %t.ll \
7 ; RUN: | llvm-dwarfdump -v - | FileCheck %s --check-prefix=DWARF
8
9 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
10 target triple = "spir64-unknown-unknown"
11
12 define i1 @test() !dbg !4 {
13 entry:
14 %end = alloca i64, align 8
15 br label %while.cond
16
17 while.cond:
18 call void @llvm.dbg.value(metadata i64* %end, metadata !5, metadata !6), !dbg !7
19 %call = call i1 @fn(i64* %end, i64* %end, i64* null, i8* null, i64 0, i64* null, i32* null, i8* null), !dbg !7
20 br label %while.body
21
22 while.body:
23 br i1 0, label %while.end, label %while.cond
24
25 while.end:
26 ret i1 true
27 }
28
29 ; CHECK-LABEL: test
30 ; CHECK: #DEBUG_VALUE: test:w <- [DW_OP_plus_uconst 8, DW_OP_deref] $rsp
31 ; DWARF: DW_AT_location [DW_FORM_sec_offset] (
32 ; DWARF-NEXT: {{.*}}, {{.*}}: DW_OP_breg7 RSP+8)
33
34 declare i1 @fn(i64*, i64*, i64*, i8*, i64, i64*, i32*, i8*)
35 declare void @llvm.dbg.value(metadata, metadata, metadata)
36
37 !llvm.dbg.cu = !{!0}
38 !llvm.module.flags = !{!2,!3}
39
40 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 4.0.0", emissionKind: FullDebug)
41 !1 = !DIFile(filename: "test.c", directory: "/")
42 !2 = !{i32 2, !"Dwarf Version", i32 4}
43 !3 = !{i32 2, !"Debug Info Version", i32 3}
44 !4 = distinct !DISubprogram(name: "test", type: !10, unit: !0)
45 !5 = !DILocalVariable(name: "w", scope: !4, type: !9)
46 !6 = !DIExpression(DW_OP_deref)
47 !7 = !DILocation(line: 210, column: 12, scope: !4)
48 !8 = !{!9}
49 !9 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
50 !10 = !DISubroutineType(types: !8)