150 lines · plain
1; RUN: llc -mtriple=hexagon < %s2; REQUIRES: asserts3 4; Check that we no longer get this error:5; void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool):6; Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed.7 8target triple = "hexagon"9 10%struct.A = type { ptr, ptr }11%struct.B = type { ptr, ptr, ptr }12 13@.str.4 = external hidden unnamed_addr constant [41 x i8], align 114@__func__.fred = external hidden unnamed_addr constant [16 x i8], align 115@.str.5 = external hidden unnamed_addr constant [43 x i8], align 116 17; Function Attrs: nounwind18declare void @_Assert(ptr, ptr) #019 20; Function Attrs: nounwind21define void @fred(ptr %pA, ptr %p) #0 !dbg !6 {22entry:23 tail call void @llvm.dbg.value(metadata ptr %pA, i64 0, metadata !26, metadata !28), !dbg !2924 tail call void @llvm.dbg.value(metadata ptr %p, i64 0, metadata !27, metadata !28), !dbg !3025 %cmp = icmp eq ptr %p, null, !dbg !3126 br i1 %cmp, label %cond.false, label %cond.end, !dbg !3127 28cond.false: ; preds = %entry29 tail call void @_Assert(ptr @.str.4, ptr @__func__.fred) #0, !dbg !3230 br label %cond.end, !dbg !3231 32cond.end: ; preds = %cond.false, %entry33 %cmp1 = icmp eq ptr %pA, null, !dbg !3434 br i1 %cmp1, label %cond.false3, label %cond.end4, !dbg !3435 36cond.false3: ; preds = %cond.end37 tail call void @_Assert(ptr @.str.5, ptr @__func__.fred) #0, !dbg !3538 br label %cond.end4, !dbg !3539 40cond.end4: ; preds = %cond.false3, %cond.end41 %0 = load ptr, ptr %pA, align 4, !dbg !38, !tbaa !3942 %cmp5 = icmp eq ptr %0, null, !dbg !4443 br i1 %cmp5, label %if.then, label %if.end, !dbg !4544 45if.then: ; preds = %cond.end446 %p1 = getelementptr inbounds %struct.A, ptr %pA, i32 0, i32 1, !dbg !4647 store ptr %p, ptr %p1, align 4, !dbg !48, !tbaa !4948 store ptr %p, ptr %pA, align 4, !dbg !50, !tbaa !3949 %p4 = getelementptr inbounds %struct.B, ptr %p, i32 0, i32 1, !dbg !5150 store ptr null, ptr %p4, align 4, !dbg !52, !tbaa !5351 %p5 = getelementptr inbounds %struct.B, ptr %p, i32 0, i32 2, !dbg !5552 store ptr null, ptr %p5, align 4, !dbg !56, !tbaa !5753 br label %return, !dbg !5854 55if.end: ; preds = %cond.end456 %1 = ptrtoint ptr %0 to i32, !dbg !5957 %p57 = getelementptr inbounds %struct.B, ptr %p, i32 0, i32 2, !dbg !6058 store ptr null, ptr %p57, align 4, !dbg !61, !tbaa !5759 %p49 = getelementptr inbounds %struct.B, ptr %p, i32 0, i32 1, !dbg !6260 store i32 %1, ptr %p49, align 4, !dbg !63, !tbaa !5361 %p511 = getelementptr inbounds %struct.B, ptr %0, i32 0, i32 2, !dbg !6462 store ptr %p, ptr %p511, align 4, !dbg !65, !tbaa !5763 store ptr %p, ptr %pA, align 4, !dbg !66, !tbaa !3964 br label %return, !dbg !6765 66return: ; preds = %if.end, %if.then67 ret void, !dbg !6868}69 70; Function Attrs: nounwind readnone71declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #172 73attributes #0 = { nounwind }74attributes #1 = { nounwind readnone }75 76!llvm.dbg.cu = !{!0}77!llvm.module.flags = !{!3, !4}78!llvm.ident = !{!5}79 80!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)81!1 = !DIFile(filename: "bug.c", directory: "/")82!2 = !{}83!3 = !{i32 2, !"Dwarf Version", i32 4}84!4 = !{i32 2, !"Debug Info Version", i32 3}85!5 = !{!"clang version 3.9.0"}86!6 = distinct !DISubprogram(name: "fred", scope: !1, file: !1, line: 138, type: !7, isLocal: false, isDefinition: true, scopeLine: 139, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !25)87!7 = !DISubroutineType(types: !8)88!8 = !{null, !9, !15}89!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 32, align: 32)90!10 = !DIDerivedType(tag: DW_TAG_typedef, name: "A", file: !11, line: 57, baseType: !12)91!11 = !DIFile(filename: "bug.h", directory: "/")92!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !11, line: 54, size: 64, align: 32, elements: !13)93!13 = !{!14, !24}94!14 = !DIDerivedType(tag: DW_TAG_member, name: "p2", scope: !12, file: !11, line: 55, baseType: !15, size: 32, align: 32)95!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 32, align: 32)96!16 = !DIDerivedType(tag: DW_TAG_typedef, name: "B", file: !11, line: 50, baseType: !17)97!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !11, line: 45, size: 96, align: 32, elements: !18)98!18 = !{!19, !21, !23}99!19 = !DIDerivedType(tag: DW_TAG_member, name: "p3", scope: !17, file: !11, line: 47, baseType: !20, size: 32, align: 32)100!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32, align: 32)101!21 = !DIDerivedType(tag: DW_TAG_member, name: "p4", scope: !17, file: !11, line: 48, baseType: !22, size: 32, align: 32, offset: 32)102!22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 32, align: 32)103!23 = !DIDerivedType(tag: DW_TAG_member, name: "p5", scope: !17, file: !11, line: 49, baseType: !22, size: 32, align: 32, offset: 64)104!24 = !DIDerivedType(tag: DW_TAG_member, name: "p1", scope: !12, file: !11, line: 56, baseType: !15, size: 32, align: 32, offset: 32)105!25 = !{!26, !27}106!26 = !DILocalVariable(name: "pA", arg: 1, scope: !6, file: !1, line: 138, type: !9)107!27 = !DILocalVariable(name: "p", arg: 2, scope: !6, file: !1, line: 138, type: !15)108!28 = !DIExpression()109!29 = !DILocation(line: 138, column: 34, scope: !6)110!30 = !DILocation(line: 138, column: 57, scope: !6)111!31 = !DILocation(line: 140, column: 5, scope: !6)112!32 = !DILocation(line: 140, column: 5, scope: !33)113!33 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2)114!34 = !DILocation(line: 141, column: 5, scope: !6)115!35 = !DILocation(line: 141, column: 5, scope: !33)116!36 = !DILocation(line: 143, column: 30, scope: !37)117!37 = distinct !DILexicalBlock(scope: !6, file: !1, line: 143, column: 9)118!38 = !DILocation(line: 155, column: 18, scope: !6)119!39 = !{!40, !41, i64 0}120!40 = !{!"", !41, i64 0, !41, i64 4}121!41 = !{!"any pointer", !42, i64 0}122!42 = !{!"omnipotent char", !43, i64 0}123!43 = !{!"Simple C/C++ TBAA"}124!44 = !DILocation(line: 143, column: 14, scope: !37)125!45 = !DILocation(line: 143, column: 9, scope: !6)126!46 = !DILocation(line: 146, column: 26, scope: !47)127!47 = distinct !DILexicalBlock(scope: !37, file: !1, line: 143, column: 41)128!48 = !DILocation(line: 146, column: 36, scope: !47)129!49 = !{!40, !41, i64 4}130!50 = !DILocation(line: 145, column: 32, scope: !47)131!51 = !DILocation(line: 147, column: 20, scope: !47)132!52 = !DILocation(line: 147, column: 29, scope: !47)133!53 = !{!54, !41, i64 4}134!54 = !{!"B", !41, i64 0, !41, i64 4, !41, i64 8}135!55 = !DILocation(line: 148, column: 20, scope: !47)136!56 = !DILocation(line: 148, column: 29, scope: !47)137!57 = !{!54, !41, i64 8}138!58 = !DILocation(line: 149, column: 9, scope: !47)139!59 = !DILocation(line: 154, column: 41, scope: !6)140!60 = !DILocation(line: 153, column: 16, scope: !6)141!61 = !DILocation(line: 153, column: 25, scope: !6)142!62 = !DILocation(line: 154, column: 16, scope: !6)143!63 = !DILocation(line: 154, column: 26, scope: !6)144!64 = !DILocation(line: 155, column: 29, scope: !6)145!65 = !DILocation(line: 155, column: 39, scope: !6)146!66 = !DILocation(line: 156, column: 28, scope: !6)147!67 = !DILocation(line: 157, column: 1, scope: !6)148!68 = !DILocation(line: 157, column: 1, scope: !69)149!69 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 1)150