xref: /llvm-project/llvm/test/DebugInfo/Generic/2010-05-03-OriginDIE.ll (revision 5a288fa32e0c91b211e39f3e370255916902f898)
1
2;RUN: llc < %s -o /dev/null
3;Radar 7937109
4
5;XCore default subtarget does not support 8-byte alignment on stack.
6;XFAIL: target=xcore{{.*}}
7
8%struct.anon = type { i64, i32, i32, i32, [1 x i32] }
9%struct.gpm_t = type { i32, ptr, [16 x i8], i32, i64, i64, i64, i64, i64, i64, i32, i16, i16, [8 x %struct.gpmr_t] }
10%struct.gpmr_t = type { [48 x i8], [48 x i8], [16 x i8], i64, i64, i64, i64, i16 }
11%struct.gpt_t = type { [8 x i8], i32, i32, i32, i32, i64, i64, i64, i64, [16 x i8], %struct.anon }
12
13@llvm.used = appending global [1 x ptr] [ptr @gpt2gpm], section "llvm.metadata" ; <ptr> [#uses=0]
14
15define fastcc void @gpt2gpm(ptr %gpm, ptr %gpt) nounwind optsize ssp {
16entry:
17  %data_addr.i18 = alloca i64, align 8            ; <ptr> [#uses=1]
18  %data_addr.i17 = alloca i64, align 8            ; <ptr> [#uses=2]
19  %data_addr.i16 = alloca i64, align 8            ; <ptr> [#uses=0]
20  %data_addr.i15 = alloca i32, align 4            ; <ptr> [#uses=0]
21  %data_addr.i = alloca i64, align 8              ; <ptr> [#uses=0]
22  %0 = getelementptr inbounds %struct.gpm_t, ptr %gpm, i32 0, i32 2, i32 0 ; <ptr> [#uses=1]
23  %1 = getelementptr inbounds %struct.gpt_t, ptr %gpt, i32 0, i32 9, i32 0 ; <ptr> [#uses=1]
24  call void @uuid_LtoB(ptr %0, ptr %1) nounwind, !dbg !0
25  %a9 = load volatile i64, ptr %data_addr.i18, align 8 ; <i64> [#uses=1]
26  %a10 = call i64 @llvm.bswap.i64(i64 %a9) nounwind ; <i64> [#uses=1]
27  %a11 = getelementptr inbounds %struct.gpt_t, ptr %gpt, i32 0, i32 8, !dbg !7 ; <ptr> [#uses=1]
28  %a12 = load i64, ptr %a11, align 4, !dbg !7         ; <i64> [#uses=1]
29  call void @llvm.dbg.declare(metadata ptr %data_addr.i17, metadata !8, metadata !DIExpression()) nounwind, !dbg !14
30  store i64 %a12, ptr %data_addr.i17, align 8
31  call void @llvm.dbg.value(metadata !6, metadata !15, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
32  call void @llvm.dbg.value(metadata i32 0, metadata !19, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
33  call void @llvm.dbg.declare(metadata !6, metadata !23, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
34  call void @llvm.dbg.value(metadata ptr %data_addr.i17, metadata !34, metadata !DIExpression(DW_OP_deref)) nounwind, !dbg !DILocation(scope: !24)
35  %a13 = load volatile i64, ptr %data_addr.i17, align 8 ; <i64> [#uses=1]
36  %a14 = call i64 @llvm.bswap.i64(i64 %a13) nounwind ; <i64> [#uses=2]
37  %a15 = add i64 %a10, %a14, !dbg !7              ; <i64> [#uses=1]
38  %a16 = sub i64 %a15, %a14                       ; <i64> [#uses=1]
39  %a17 = getelementptr inbounds %struct.gpm_t, ptr %gpm, i32 0, i32 5, !dbg !7 ; <ptr> [#uses=1]
40  store i64 %a16, ptr %a17, align 4, !dbg !7
41  ret void, !dbg !7
42}
43
44declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
45
46declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
47
48declare i32 @llvm.bswap.i32(i32) nounwind readnone
49
50declare i64 @llvm.bswap.i64(i64) nounwind readnone
51
52declare void @uuid_LtoB(ptr, ptr)
53
54!llvm.dbg.cu = !{!4}
55!llvm.module.flags = !{!41}
56!0 = !DILocation(line: 808, scope: !1)
57!1 = distinct !DILexicalBlock(line: 807, column: 0, file: !39, scope: !2)
58!2 = distinct !DISubprogram(name: "gpt2gpm", linkageName: "gpt2gpm", line: 807, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, file: !39, scope: null, type: !5)
59!3 = !DIFile(filename: "G.c", directory: "/tmp")
60!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "llvm-gcc", isOptimized: true, emissionKind: FullDebug, file: !39, enums: !18, retainedTypes: !18)
61!5 = !DISubroutineType(types: !6)
62!6 = !{null}
63!7 = !DILocation(line: 810, scope: !1)
64!8 = !DILocalVariable(name: "data", line: 201, arg: 1, scope: !9, file: !10, type: !11)
65!9 = distinct !DISubprogram(name: "_OSSwapInt64", linkageName: "_OSSwapInt64", line: 202, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, file: !10, scope: null, type: !5)
66!10 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
67!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint64_t", line: 59, file: !36, scope: !3, baseType: !13)
68!12 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
69!13 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
70!14 = !DILocation(line: 202, scope: !9, inlinedAt: !7)
71!15 = !DILocalVariable(name: "base", line: 92, arg: 2, scope: !16, file: !10, type: !17)
72!16 = distinct !DISubprogram(name: "OSReadSwapInt64", linkageName: "OSReadSwapInt64", line: 95, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, file: !38, scope: null, type: !5)
73!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: null)
74!18 = !{}
75!19 = !DILocalVariable(name: "byteOffset", line: 94, arg: 3, scope: !16, file: !10, type: !20)
76!20 = !DIDerivedType(tag: DW_TAG_typedef, name: "uintptr_t", line: 114, file: !37, scope: !3, baseType: !22)
77!21 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
78!22 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
79!23 = !DILocalVariable(name: "u", line: 100, scope: !24, file: !10, type: !25)
80!24 = distinct !DILexicalBlock(line: 95, column: 0, file: !38, scope: !16)
81!25 = !DICompositeType(tag: DW_TAG_union_type, line: 97, size: 64, align: 64, file: !38, scope: !16, elements: !26)
82!26 = !{!27, !28}
83!27 = !DIDerivedType(tag: DW_TAG_member, name: "u64", line: 98, size: 64, align: 64, file: !38, scope: !25, baseType: !11)
84!28 = !DIDerivedType(tag: DW_TAG_member, name: "u32", line: 99, size: 64, align: 32, file: !38, scope: !25, baseType: !29)
85!29 = !DICompositeType(tag: DW_TAG_array_type, size: 64, align: 32, file: !39, scope: !3, baseType: !30, elements: !32)
86!30 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", line: 55, file: !36, scope: !3, baseType: !31)
87!31 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
88!32 = !{!33}
89!33 = !DISubrange(count: 2)
90!34 = !DILocalVariable(name: "addr", line: 96, scope: !24, file: !10, type: !35)
91!35 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !39, scope: !3, baseType: !11)
92!36 = !DIFile(filename: "stdint.h", directory: "/usr/4.2.1/include")
93!37 = !DIFile(filename: "types.h", directory: "/usr/include/ppc")
94!38 = !DIFile(filename: "OSByteOrder.h", directory: "/usr/include/libkern/ppc")
95!39 = !DIFile(filename: "G.c", directory: "/tmp")
96!41 = !{i32 1, !"Debug Info Version", i32 3}
97