Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/default-subrange-array.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 -O0 -filetype=obj -dwarf-version 4 \
6 ; RUN: -o - < %s | llvm-dwarfdump -v - --debug-info \
7 ; RUN: | FileCheck %s -check-prefixes=CHECK,DWARF4
8 ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -dwarf-version 5 \
9 ; RUN: -o - < %s | llvm-dwarfdump -v - --debug-info \
10 ; RUN: | FileCheck %s -check-prefixes=CHECK,DWARF5
11
12 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"
13 target triple = "spir64-unknown-unknown"
14
15 ; Check that we can omit default array lower-bounds.
16 ; DW_LANG_C_plus_plus_11 is new in DWARF v5, so if we use that with
17 ; DWARF v4, we should get the DW_AT_lower_bound attribute.
18
19 source_filename = "test/DebugInfo/X86/default-subrange-array.ll"
20
21 %class.A = type { [42 x i32] }
22
23 @a = global %class.A zeroinitializer, align 4, !dbg !0
24
25 ; CHECK: DW_TAG_class_type
26 ; CHECK: DW_TAG_member
27 ; CHECK-NEXT: DW_AT_name {{.*}} "x"
28 ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] {{.*}} => {[[ARRAY:0x[0-9a-f]+]]}
29
30 ; CHECK: [[ARRAY]]: DW_TAG_array_type
31 ; CHECK-NEXT: DW_AT_type
32 ; CHECK: DW_TAG_subrange_type
33 ; CHECK-NEXT: DW_AT_type
34 ; DWARF4-NEXT: DW_AT_lower_bound [DW_FORM_sdata] (0)
35 ; CHECK-NEXT: DW_AT_count [DW_FORM_data1] (0x2a)
36 ; DWARF5-NOT: DW_AT_lower_bound
37
38
39 !llvm.dbg.cu = !{!14}
40 !llvm.module.flags = !{!17}
41
42 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
43 !1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
44 !2 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm")
45 !3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, align: 32, elements: !4)
46 !4 = !{!5, !10}
47 !5 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !3, file: !2, line: 1, baseType: !6, flags: DIFlagPrivate)
48 !6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, align: 32, elements: !8)
49 !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
50 !8 = !{!9}
51 !9 = !DISubrange(count: 42, lowerBound: 0)
52 !10 = !DISubprogram(name: "A", scope: !3, file: !2, line: 1, type: !11, isLocal: false, isDefinition: false, scopeLine: 1, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
53 !11 = !DISubroutineType(types: !12)
54 !12 = !{null, !13}
55 !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
56 !14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11, file: !2, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !15, retainedTypes: !15, globals: !16, imports: !15)
57 !15 = !{}
58 !16 = !{!0}
59 !17 = !{i32 1, !"Debug Info Version", i32 3}
60