1 # RUN: llc -o - %s -mtriple=thumbv7-apple-ios -start-after=patchable-function | FileCheck %s
2 # RUN: llc -o - %s -mtriple=thumbv6-apple-ios -start-after=patchable-function | FileCheck %s
14 # CHECK: .loc 1 9 0 prologue_end
15 # CHECK-NOT: .loc 1 0 0 prologue_end
17 # The location of the prologue_end marker should not be affected by the presence
18 # of CFI instructions.
21 %struct.B = type { %struct.A }
22 %struct.A = type { i32 (...)** }
24 @_ZTV1B = external unnamed_addr constant [4 x i8*]
26 ; Function Attrs: nounwind
27 define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !31 {
29 tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !33, metadata !DIExpression()), !dbg !35
30 %0 = bitcast %struct.B* %this to %struct.A*, !dbg !36
31 %call = tail call %struct.A* @_ZN1AC2Ev(%struct.A* %0) #0, !dbg !36
32 %1 = bitcast %struct.B* %this to i32 (...)***, !dbg !36
33 store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1B, i32 0, i32 2) to i32 (...)**), i32 (...)*** %1, align 4, !dbg !36, !tbaa !37
34 ret %struct.B* %this, !dbg !36
37 declare %struct.A* @_ZN1AC2Ev(%struct.A*)
39 ; Function Attrs: nounwind
40 define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !40 {
42 tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !42, metadata !DIExpression()), !dbg !43
43 tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !33, metadata !DIExpression()) #0, !dbg !44
44 %0 = bitcast %struct.B* %this to %struct.A*, !dbg !46
45 %call.i = tail call %struct.A* @_ZN1AC2Ev(%struct.A* %0) #0, !dbg !46
46 %1 = bitcast %struct.B* %this to i32 (...)***, !dbg !46
47 store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1B, i32 0, i32 2) to i32 (...)**), i32 (...)*** %1, align 4, !dbg !46, !tbaa !37
48 ret %struct.B* %this, !dbg !45
51 ; Function Attrs: nounwind readnone speculatable
52 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
54 declare void @_Unwind_SjLj_Register({ i8*, i32, [4 x i32], i8*, i8*, [5 x i8*] }*)
56 declare void @_Unwind_SjLj_Unregister({ i8*, i32, [4 x i32], i8*, i8*, [5 x i8*] }*)
58 ; Function Attrs: nounwind readnone
59 declare i8* @llvm.frameaddress(i32) #2
61 ; Function Attrs: nounwind
62 declare i8* @llvm.stacksave() #0
64 ; Function Attrs: nounwind
65 declare void @llvm.stackrestore(i8*) #0
67 ; Function Attrs: nounwind
68 declare void @llvm.eh.sjlj.setup.dispatch() #0
70 ; Function Attrs: nounwind readnone
71 declare i8* @llvm.eh.sjlj.lsda() #2
73 ; Function Attrs: nounwind readnone
74 declare void @llvm.eh.sjlj.callsite(i32) #2
76 ; Function Attrs: nounwind
77 declare void @llvm.eh.sjlj.functioncontext(i8*) #0
79 ; Function Attrs: nounwind
80 declare void @llvm.stackprotector(i8*, i8**) #0
82 attributes #0 = { nounwind }
83 attributes #1 = { nounwind readnone speculatable }
84 attributes #2 = { nounwind readnone }
87 !llvm.module.flags = !{!26, !27, !28, !29}
90 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
91 !1 = !DIFile(filename: "<stdin>", directory: "")
94 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !5, line: 5, size: 32, align: 32, elements: !6, vtableHolder: !8, identifier: "_ZTS1B")
95 !5 = !DIFile(filename: "test1.cpp", directory: "")
97 !7 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !4, baseType: !8)
98 !8 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !5, line: 1, size: 32, align: 32, elements: !9, vtableHolder: !8, identifier: "_ZTS1A")
100 !10 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !5, file: !5, baseType: !11, size: 32, flags: DIFlagArtificial)
101 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 32)
102 !12 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !13, size: 32)
103 !13 = !DISubroutineType(types: !14)
105 !15 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
106 !16 = !DISubprogram(name: "A", scope: !8, file: !5, line: 2, type: !17, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true)
107 !17 = !DISubroutineType(types: !18)
109 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
110 !20 = !DISubprogram(name: "~A", scope: !8, file: !5, line: 3, type: !17, isLocal: false, isDefinition: false, scopeLine: 3, containingType: !8, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: true)
111 !21 = !DISubprogram(name: "B", scope: !4, file: !5, line: 6, type: !22, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true)
112 !22 = !DISubroutineType(types: !23)
114 !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 32, align: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
115 !25 = !DISubprogram(name: "~B", scope: !4, file: !5, line: 7, type: !22, isLocal: false, isDefinition: false, scopeLine: 7, containingType: !4, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped, isOptimized: true)
116 !26 = !{i32 2, !"Dwarf Version", i32 4}
117 !27 = !{i32 2, !"Debug Info Version", i32 3}
118 !28 = !{i32 1, !"wchar_size", i32 4}
119 !29 = !{i32 1, !"min_enum_size", i32 4}
120 !30 = !{!"clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)"}
121 !31 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", scope: !4, file: !5, line: 9, type: !22, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !21, retainedNodes: !32)
123 !33 = !DILocalVariable(name: "this", arg: 1, scope: !31, type: !34, flags: DIFlagArtificial | DIFlagObjectPointer)
124 !34 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 32, align: 32)
125 !35 = !DILocation(line: 0, scope: !31)
126 !36 = !DILocation(line: 9, scope: !31)
127 !37 = !{!38, !38, i64 0}
128 !38 = !{!"vtable pointer", !39, i64 0}
129 !39 = !{!"Simple C/C++ TBAA"}
130 !40 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", scope: !4, file: !5, line: 9, type: !22, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !21, retainedNodes: !41)
132 !42 = !DILocalVariable(name: "this", arg: 1, scope: !40, type: !34, flags: DIFlagArtificial | DIFlagObjectPointer)
133 !43 = !DILocation(line: 0, scope: !40)
134 !44 = !DILocation(line: 0, scope: !31, inlinedAt: !45)
135 !45 = !DILocation(line: 9, scope: !40)
136 !46 = !DILocation(line: 9, scope: !31, inlinedAt: !45)
151 - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, stack-id: default,
152 callee-saved-register: '$lr', callee-saved-restored: false }
153 - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, stack-id: default,
154 callee-saved-register: '$r4' }
157 frame-setup tPUSH 14, $noreg, killed $r4, killed $lr, implicit-def $sp, implicit $sp
158 frame-setup CFI_INSTRUCTION def_cfa_offset 8
159 frame-setup CFI_INSTRUCTION offset $lr, -4
160 frame-setup CFI_INSTRUCTION offset $r4, -8
161 DBG_VALUE debug-use $r0, debug-use $noreg, !33, !DIExpression(), debug-location !35
162 $r4 = tMOVr $r0, 14, $noreg
163 DBG_VALUE debug-use $r4, debug-use $noreg, !33, !DIExpression(), debug-location !35
164 tBL 14, $noreg, @_ZN1AC2Ev, csr_ios, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def dead $r0, debug-location !36
165 $r0 = t2MOVi16_ga_pcrel target-flags(arm-lo16, arm-nonlazy) @_ZTV1B, 0, debug-location !36
166 $r0 = t2MOVTi16_ga_pcrel killed $r0, target-flags(arm-hi16, arm-nonlazy) @_ZTV1B, 0, debug-location !36
167 $r0 = tPICADD killed $r0, 0, debug-location !36
168 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg, debug-location !36 :: (load 4 from got)
169 renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 8, 14, $noreg, debug-location !36
170 tSTRi killed renamable $r0, renamable $r4, 0, 14, $noreg, debug-location !36 :: (store 4 into %ir.1, !tbaa !37)
171 $r0 = tMOVr killed $r4, 14, $noreg, debug-location !36
172 tPOP_RET 14, $noreg, def $r4, def $pc, implicit killed $r0, debug-location !36
187 - { id: 0, type: spill-slot, offset: -4, size: 4, alignment: 4, stack-id: default,
188 callee-saved-register: '$lr', callee-saved-restored: false }
189 - { id: 1, type: spill-slot, offset: -8, size: 4, alignment: 4, stack-id: default,
190 callee-saved-register: '$r4' }
193 frame-setup tPUSH 14, $noreg, killed $r4, killed $lr, implicit-def $sp, implicit $sp
194 frame-setup CFI_INSTRUCTION def_cfa_offset 8
195 frame-setup CFI_INSTRUCTION offset $lr, -4
196 frame-setup CFI_INSTRUCTION offset $r4, -8
197 DBG_VALUE debug-use $r0, debug-use $noreg, !42, !DIExpression(), debug-location !43
198 DBG_VALUE debug-use $r0, debug-use $noreg, !33, !DIExpression(), debug-location !44
199 $r4 = tMOVr $r0, 14, $noreg
200 DBG_VALUE debug-use $r4, debug-use $noreg, !33, !DIExpression(), debug-location !44
201 DBG_VALUE debug-use $r4, debug-use $noreg, !42, !DIExpression(), debug-location !43
202 tBL 14, $noreg, @_ZN1AC2Ev, csr_ios, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit-def $sp, implicit-def dead $r0, debug-location !46
203 $r0 = t2MOVi16_ga_pcrel target-flags(arm-lo16, arm-nonlazy) @_ZTV1B, 0, debug-location !46
204 $r0 = t2MOVTi16_ga_pcrel killed $r0, target-flags(arm-hi16, arm-nonlazy) @_ZTV1B, 0, debug-location !46
205 $r0 = tPICADD killed $r0, 0, debug-location !46
206 renamable $r0 = tLDRi killed renamable $r0, 0, 14, $noreg, debug-location !46 :: (load 4 from got)
207 renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 8, 14, $noreg, debug-location !46
208 tSTRi killed renamable $r0, renamable $r4, 0, 14, $noreg, debug-location !46 :: (store 4 into %ir.1, !tbaa !37)
209 $r0 = tMOVr killed $r4, 14, $noreg, debug-location !45
210 tPOP_RET 14, $noreg, def $r4, def $pc, implicit killed $r0, debug-location !45