brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.5 KiB · f07b999 Raw
151 lines · plain
1; RUN: llc %s -o /dev/null2; PR 2613.3 4%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo }5%struct.__type_info_pseudo = type { ptr, ptr }6%struct.test1 = type { ptr }7 8@_ZTV5test1 = weak_odr constant [4 x ptr] [ptr null, ptr @_ZTI5test1, ptr @_ZN5test1D1Ev, ptr @_ZN5test1D0Ev], align 32 ; <ptr> [#uses=1]9@_ZTI5test1 = weak_odr constant %struct.__class_type_info_pseudo { %struct.__type_info_pseudo { ptr getelementptr (i8, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 16), ptr @_ZTS5test1 } }, align 16 ; <ptr> [#uses=1]10@_ZTVN10__cxxabiv117__class_type_infoE = external constant [0 x ptr] ; <ptr> [#uses=1]11@_ZTS5test1 = weak_odr constant [7 x i8] c"5test1\00" ; <ptr> [#uses=2]12 13define i32 @main() nounwind ssp {14entry:15  %retval = alloca i32                            ; <ptr> [#uses=2]16  %0 = alloca i32                                 ; <ptr> [#uses=2]17  %tst = alloca %struct.test1                     ; <ptr> [#uses=1]18  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]19  call void @llvm.dbg.declare(metadata ptr %tst, metadata !0, metadata !DIExpression()), !dbg !2120  call void @_ZN5test1C1Ev(ptr %tst) nounwind, !dbg !2221  store i32 0, ptr %0, align 4, !dbg !2322  %1 = load i32, ptr %0, align 4, !dbg !23            ; <i32> [#uses=1]23  store i32 %1, ptr %retval, align 4, !dbg !2324  br label %return, !dbg !2325 26return:                                           ; preds = %entry27  %retval1 = load i32, ptr %retval, !dbg !23          ; <i32> [#uses=1]28  ret i32 %retval1, !dbg !2329}30 31define linkonce_odr void @_ZN5test1C1Ev(ptr %this) nounwind ssp align 2 {32entry:33  %this_addr = alloca ptr              ; <ptr> [#uses=2]34  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]35  call void @llvm.dbg.declare(metadata ptr %this_addr, metadata !24, metadata !DIExpression()), !dbg !2836  store ptr %this, ptr %this_addr37  %0 = load ptr, ptr %this_addr, align 8, !dbg !28 ; <ptr> [#uses=1]38  store ptr getelementptr inbounds ([4 x ptr], ptr @_ZTV5test1, i64 0, i64 2), ptr %0, align 8, !dbg !2839  br label %return, !dbg !2840 41return:                                           ; preds = %entry42  ret void, !dbg !2943}44 45declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone46 47define linkonce_odr void @_ZN5test1D1Ev(ptr %this) nounwind ssp align 2 {48entry:49  %this_addr = alloca ptr              ; <ptr> [#uses=3]50  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]51  call void @llvm.dbg.declare(metadata ptr %this_addr, metadata !32, metadata !DIExpression()), !dbg !3452  store ptr %this, ptr %this_addr53  %0 = load ptr, ptr %this_addr, align 8, !dbg !35 ; <ptr> [#uses=1]54  store ptr getelementptr inbounds ([4 x ptr], ptr @_ZTV5test1, i64 0, i64 2), ptr %0, align 8, !dbg !3555  br label %bb, !dbg !3756 57bb:                                               ; preds = %entry58  %1 = trunc i32 0 to i8, !dbg !37                ; <i8> [#uses=1]59  %toBool = icmp ne i8 %1, 0, !dbg !37            ; <i1> [#uses=1]60  br i1 %toBool, label %bb1, label %bb2, !dbg !3761 62bb1:                                              ; preds = %bb63  %2 = load ptr, ptr %this_addr, align 8, !dbg !37 ; <ptr> [#uses=1]64  call void @_ZdlPv(ptr %2) nounwind, !dbg !3765  br label %bb2, !dbg !3766 67bb2:                                              ; preds = %bb1, %bb68  br label %return, !dbg !3769 70return:                                           ; preds = %bb271  ret void, !dbg !3772}73 74define linkonce_odr void @_ZN5test1D0Ev(ptr %this) nounwind ssp align 2 {75entry:76  %this_addr = alloca ptr              ; <ptr> [#uses=3]77  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]78  call void @llvm.dbg.declare(metadata ptr %this_addr, metadata !38, metadata !DIExpression()), !dbg !4079  store ptr %this, ptr %this_addr80  %0 = load ptr, ptr %this_addr, align 8, !dbg !41 ; <ptr> [#uses=1]81  store ptr getelementptr inbounds ([4 x ptr], ptr @_ZTV5test1, i64 0, i64 2), ptr %0, align 8, !dbg !4182  br label %bb, !dbg !4383 84bb:                                               ; preds = %entry85  %1 = trunc i32 1 to i8, !dbg !43                ; <i8> [#uses=1]86  %toBool = icmp ne i8 %1, 0, !dbg !43            ; <i1> [#uses=1]87  br i1 %toBool, label %bb1, label %bb2, !dbg !4388 89bb1:                                              ; preds = %bb90  %2 = load ptr, ptr %this_addr, align 8, !dbg !43 ; <ptr> [#uses=1]91  call void @_ZdlPv(ptr %2) nounwind, !dbg !4392  br label %bb2, !dbg !4393 94bb2:                                              ; preds = %bb1, %bb95  br label %return, !dbg !4396 97return:                                           ; preds = %bb298  ret void, !dbg !4399}100 101declare void @_ZdlPv(ptr) nounwind102 103!llvm.dbg.cu = !{!4}104!0 = !DILocalVariable(name: "tst", line: 13, scope: !1, file: !4, type: !8)105!1 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !2)106!2 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !3)107!3 = distinct !DISubprogram(name: "main", linkageName: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, scope: !4, type: !5)108!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: FullDebug, file: !44, enums: !45, retainedTypes: !45)109!5 = !DISubroutineType(types: !6)110!6 = !{!7}111!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)112!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "test1", line: 1, size: 64, align: 64, file: !44, scope: !4, elements: !9, vtableHolder: !8)113!9 = !{!10, !14, !18}114!10 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$test1", line: 1, size: 64, align: 64, file: !44, scope: !8, baseType: !11)115!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !4, baseType: !12)116!12 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", scope: !4, baseType: !5)117!13 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !46, enums: !45, retainedTypes: !45)118!14 = !DISubprogram(name: "test1", line: 1, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrivate, isOptimized: false, scope: !8, type: !15)119!15 = !DISubroutineType(types: !16)120!16 = !{null, !17}121!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !4, baseType: !8)122!18 = !DISubprogram(name: "~test1", line: 4, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, scope: !8, type: !19, containingType: !8)123!19 = !DISubroutineType(types: !20)124!20 = !{null, !17, !7}125!21 = !DILocation(line: 11, scope: !1)126!22 = !DILocation(line: 13, scope: !1)127!23 = !DILocation(line: 14, scope: !1)128!24 = !DILocalVariable(name: "this", line: 13, arg: 1, scope: !25, file: !4, type: !26)129!25 = distinct !DISubprogram(name: "test1", linkageName: "_ZN5test1C1Ev", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, scope: !4, type: !15)130!26 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !4, baseType: !27)131!27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !4, baseType: !8)132!28 = !DILocation(line: 1, scope: !25)133!29 = !DILocation(line: 1, scope: !30)134!30 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !31)135!31 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !25)136!32 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !33, file: !4, type: !26)137!33 = distinct !DISubprogram(name: "~test1", linkageName: "_ZN5test1D1Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, unit: !4, scope: !8, type: !15, containingType: !8)138!34 = !DILocation(line: 4, scope: !33)139!35 = !DILocation(line: 5, scope: !36)140!36 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !33)141!37 = !DILocation(line: 6, scope: !36)142!38 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !39, file: !4, type: !26)143!39 = distinct !DISubprogram(name: "~test1", linkageName: "_ZN5test1D0Ev", line: 4, isLocal: false, isDefinition: true, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, isOptimized: false, unit: !4, scope: !8, type: !15, containingType: !8)144!40 = !DILocation(line: 4, scope: !39)145!41 = !DILocation(line: 5, scope: !42)146!42 = distinct !DILexicalBlock(line: 0, column: 0, file: !44, scope: !39)147!43 = !DILocation(line: 6, scope: !42)148!44 = !DIFile(filename: "inheritance.cpp", directory: "/tmp/")149!45 = !{i32 0}150!46 = !DIFile(filename: "<built-in>", directory: "/tmp/")151