Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/dbg-byval-parameter.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=%triple -march=x86 -asm-verbose < %t.ll | grep DW_TAG_formal_parameter
6
7 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"
8 target triple = "spir64-unknown-unknown"
9
10
11 %struct.Pt = type { double, double }
12 %struct.Rect = type { %struct.Pt, %struct.Pt }
13
14 define double @foo(%struct.Rect* byval(%struct.Rect) %my_r0) nounwind ssp !dbg !1 {
15 entry:
16 %retval = alloca double ; <double*> [#uses=2]
17 %0 = alloca double ; <double*> [#uses=2]
18 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
19 call void @llvm.dbg.declare(metadata %struct.Rect* %my_r0, metadata !0, metadata !DIExpression()), !dbg !15
20 %1 = getelementptr inbounds %struct.Rect, %struct.Rect* %my_r0, i32 0, i32 0, !dbg !16 ; <%struct.Pt*> [#uses=1]
21 %2 = getelementptr inbounds %struct.Pt, %struct.Pt* %1, i32 0, i32 0, !dbg !16 ; <double*> [#uses=1]
22 %3 = load double, double* %2, align 8, !dbg !16 ; <double> [#uses=1]
23 store double %3, double* %0, align 8, !dbg !16
24 %4 = load double, double* %0, align 8, !dbg !16 ; <double> [#uses=1]
25 store double %4, double* %retval, align 8, !dbg !16
26 br label %return, !dbg !16
27
28 return: ; preds = %entry
29 %retval1 = load double, double* %retval, !dbg !16 ; <double> [#uses=1]
30 ret double %retval1, !dbg !16
31 }
32
33 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
34
35 !llvm.dbg.cu = !{!3}
36 !llvm.module.flags = !{!21}
37
38 !0 = !DILocalVariable(name: "my_r0", line: 11, arg: 1, scope: !1, file: !2, type: !7)
39 !1 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !19, scope: !2, type: !4)
40 !2 = !DIFile(filename: "b2.c", directory: "/tmp/")
41 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !19, enums: !20, retainedTypes: !20, imports: null)
42 !4 = !DISubroutineType(types: !5)
43 !5 = !{!6, !7}
44 !6 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
45 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "Rect", line: 6, size: 256, align: 64, file: !19, scope: !2, elements: !8)
46 !8 = !{!9, !14}
47 !9 = !DIDerivedType(tag: DW_TAG_member, name: "P1", line: 7, size: 128, align: 64, file: !19, scope: !7, baseType: !10)
48 !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "Pt", line: 1, size: 128, align: 64, file: !19, scope: !2, elements: !11)
49 !11 = !{!12, !13}
50 !12 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 2, size: 64, align: 64, file: !19, scope: !10, baseType: !6)
51 !13 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 3, size: 64, align: 64, offset: 64, file: !19, scope: !10, baseType: !6)
52 !14 = !DIDerivedType(tag: DW_TAG_member, name: "P2", line: 8, size: 128, align: 64, offset: 128, file: !19, scope: !7, baseType: !10)
53 !15 = !DILocation(line: 11, scope: !1)
54 !16 = !DILocation(line: 12, scope: !17)
55 !17 = distinct !DILexicalBlock(line: 11, column: 0, file: !19, scope: !1)
56 !19 = !DIFile(filename: "b2.c", directory: "/tmp/")
57 !20 = !{}
58 !21 = !{i32 1, !"Debug Info Version", i32 3}