Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/data_member_location.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-linux -O0 -o - -filetype=obj < %t.ll | llvm-dwarfdump -v -debug-info -| FileCheck %s
6 ; RUN: llc -mtriple=x86_64-linux -dwarf-version=2 -O0 -o - -filetype=obj < %t.ll | llvm-dwarfdump -v -debug-info -| FileCheck -check-prefix=DWARF2 %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 ; Generated from Clang with the following source:
12 ;
13 ; struct foo {
14 ; char c;
15 ; int i;
16 ; };
17 ;
18 ; foo f;
19
20 ; CHECK: DW_AT_name {{.*}} "c"
21 ; CHECK-NOT: DW_TAG
22 ; CHECK: DW_AT_data_member_location {{.*}} (0x00)
23
24 ; CHECK: DW_AT_name {{.*}} "i"
25 ; CHECK-NOT: DW_TAG
26 ; CHECK: DW_AT_data_member_location {{.*}} (0x04)
27
28 ; DWARF2: DW_AT_name {{.*}} "c"
29 ; DWARF2-NOT: DW_TAG
30 ; DWARF2: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x0)
31
32 ; DWARF2: DW_AT_name {{.*}} "i"
33 ; DWARF2-NOT: DW_TAG
34 ; DWARF2: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x4)
35
36 source_filename = "test/DebugInfo/X86/data_member_location.ll"
37
38 %struct.foo = type { i8, i32 }
39
40 @f = global %struct.foo zeroinitializer, align 4, !dbg !0
41
42 !llvm.dbg.cu = !{!9}
43 !llvm.module.flags = !{!13, !14}
44 !llvm.ident = !{!15}
45
46 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
47 !1 = !DIGlobalVariable(name: "f", scope: null, file: !2, line: 6, type: !3, isLocal: false, isDefinition: true)
48 !2 = !DIFile(filename: "data_member_location.cpp", directory: "/tmp/dbginfo")
49 !3 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !2, line: 1, size: 64, align: 32, elements: !4, identifier: "_ZTS3foo")
50 !4 = !{!5, !7}
51 !5 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !3, file: !2, line: 2, baseType: !6, size: 8, align: 8)
52 !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
53 !7 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !3, file: !2, line: 3, baseType: !8, size: 32, align: 32, offset: 32)
54 !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
55 !9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !11, globals: !12, imports: !10)
56 !10 = !{}
57 !11 = !{!3}
58 !12 = !{!0}
59 !13 = !{i32 2, !"Dwarf Version", i32 4}
60 !14 = !{i32 1, !"Debug Info Version", i32 3}
61 !15 = !{!"clang version 3.4 "}
62