Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/DW_AT_specification.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-apple-darwin %t.ll -o %t -filetype=obj
6 ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
7
8 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"
9 target triple = "spir64-unknown-unknown"
10
11 ; test that the DW_AT_specification is a back edge in the file.
12
13 ; CHECK: DW_TAG_subprogram
14 ; CHECK-NEXT: DW_AT_linkage_name {{.*}} "_ZN3foo3barEv"
15 ; CHECK: DW_TAG_subprogram
16 ; CHECK-NOT: DW_TAG
17 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
18
19 source_filename = "test/DebugInfo/X86/DW_AT_specification.ll"
20
21 @_ZZN3foo3barEvE1x = constant i32 0, align 4, !dbg !0
22
23 define void @_ZN3foo3barEv() !dbg !2 {
24 entry:
25 ret void, !dbg !17
26 }
27
28 !llvm.dbg.cu = !{!8}
29 !llvm.module.flags = !{!16}
30
31 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
32 !1 = !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 5, type: !14, isLocal: true, isDefinition: true)
33 !2 = distinct !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: null, file: !3, line: 4, type: !4, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !8, declaration: !11)
34 !3 = !DIFile(filename: "nsNativeAppSupportBase.ii", directory: "/Users/espindola/mozilla-central/obj-x86_64-apple-darwin11.2.0/toolkit/library")
35 !4 = !DISubroutineType(types: !5)
36 !5 = !{null, !6}
37 !6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64, flags: DIFlagArtificial)
38 !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !3, line: 1, flags: DIFlagFwdDecl)
39 !8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.0 ()", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !9, retainedTypes: !9, globals: !10, imports: !9)
40 !9 = !{}
41 !10 = !{!0}
42 !11 = !DISubprogram(name: "bar", linkageName: "_ZN3foo3barEv", scope: !12, file: !3, line: 2, type: !4, isLocal: false, isDefinition: false, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false)
43 !12 = !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !3, line: 1, size: 8, align: 8, elements: !13)
44 !13 = !{!11}
45 !14 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !15)
46 !15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
47 !16 = !{i32 1, !"Debug Info Version", i32 3}
48 !17 = !DILocation(line: 6, column: 1, scope: !18)
49 !18 = distinct !DILexicalBlock(scope: !2, file: !3, line: 4, column: 17)
50