1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=hexagon < %s 2*9880d681SAndroid Build Coastguard Worker; REQUIRES: asserts 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; Check that we no longer get this error: 5*9880d681SAndroid Build Coastguard Worker; void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool): 6*9880d681SAndroid Build Coastguard Worker; Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed. 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Workertarget triple = "hexagon" 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker%struct.A = type { %struct.B*, %struct.B* } 11*9880d681SAndroid Build Coastguard Worker%struct.B = type { i8*, %struct.B*, %struct.B* } 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1 14*9880d681SAndroid Build Coastguard Worker@__func__.fred = external hidden unnamed_addr constant [16 x i8], align 1 15*9880d681SAndroid Build Coastguard Worker@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 18*9880d681SAndroid Build Coastguard Workerdeclare void @_Assert(i8*, i8*) #0 19*9880d681SAndroid Build Coastguard Worker 20*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 21*9880d681SAndroid Build Coastguard Workerdefine void @fred(%struct.A* %pA, %struct.B* %p) #0 !dbg !6 { 22*9880d681SAndroid Build Coastguard Workerentry: 23*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata %struct.A* %pA, i64 0, metadata !26, metadata !28), !dbg !29 24*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata %struct.B* %p, i64 0, metadata !27, metadata !28), !dbg !30 25*9880d681SAndroid Build Coastguard Worker %cmp = icmp eq %struct.B* %p, null, !dbg !31 26*9880d681SAndroid Build Coastguard Worker br i1 %cmp, label %cond.false, label %cond.end, !dbg !31 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Workercond.false: ; preds = %entry 29*9880d681SAndroid Build Coastguard Worker tail call void @_Assert(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.fred, i32 0, i32 0)) #0, !dbg !32 30*9880d681SAndroid Build Coastguard Worker br label %cond.end, !dbg !32 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Workercond.end: ; preds = %cond.false, %entry 33*9880d681SAndroid Build Coastguard Worker %cmp1 = icmp eq %struct.A* %pA, null, !dbg !34 34*9880d681SAndroid Build Coastguard Worker br i1 %cmp1, label %cond.false3, label %cond.end4, !dbg !34 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Workercond.false3: ; preds = %cond.end 37*9880d681SAndroid Build Coastguard Worker tail call void @_Assert(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.fred, i32 0, i32 0)) #0, !dbg !35 38*9880d681SAndroid Build Coastguard Worker br label %cond.end4, !dbg !35 39*9880d681SAndroid Build Coastguard Worker 40*9880d681SAndroid Build Coastguard Workercond.end4: ; preds = %cond.false3, %cond.end 41*9880d681SAndroid Build Coastguard Worker %p2 = getelementptr inbounds %struct.A, %struct.A* %pA, i32 0, i32 0, !dbg !36 42*9880d681SAndroid Build Coastguard Worker %0 = load %struct.B*, %struct.B** %p2, align 4, !dbg !38, !tbaa !39 43*9880d681SAndroid Build Coastguard Worker %cmp5 = icmp eq %struct.B* %0, null, !dbg !44 44*9880d681SAndroid Build Coastguard Worker br i1 %cmp5, label %if.then, label %if.end, !dbg !45 45*9880d681SAndroid Build Coastguard Worker 46*9880d681SAndroid Build Coastguard Workerif.then: ; preds = %cond.end4 47*9880d681SAndroid Build Coastguard Worker %p1 = getelementptr inbounds %struct.A, %struct.A* %pA, i32 0, i32 1, !dbg !46 48*9880d681SAndroid Build Coastguard Worker store %struct.B* %p, %struct.B** %p1, align 4, !dbg !48, !tbaa !49 49*9880d681SAndroid Build Coastguard Worker store %struct.B* %p, %struct.B** %p2, align 4, !dbg !50, !tbaa !39 50*9880d681SAndroid Build Coastguard Worker %p4 = getelementptr inbounds %struct.B, %struct.B* %p, i32 0, i32 1, !dbg !51 51*9880d681SAndroid Build Coastguard Worker store %struct.B* null, %struct.B** %p4, align 4, !dbg !52, !tbaa !53 52*9880d681SAndroid Build Coastguard Worker %p5 = getelementptr inbounds %struct.B, %struct.B* %p, i32 0, i32 2, !dbg !55 53*9880d681SAndroid Build Coastguard Worker store %struct.B* null, %struct.B** %p5, align 4, !dbg !56, !tbaa !57 54*9880d681SAndroid Build Coastguard Worker br label %return, !dbg !58 55*9880d681SAndroid Build Coastguard Worker 56*9880d681SAndroid Build Coastguard Workerif.end: ; preds = %cond.end4 57*9880d681SAndroid Build Coastguard Worker %1 = ptrtoint %struct.B* %0 to i32, !dbg !59 58*9880d681SAndroid Build Coastguard Worker %p57 = getelementptr inbounds %struct.B, %struct.B* %p, i32 0, i32 2, !dbg !60 59*9880d681SAndroid Build Coastguard Worker store %struct.B* null, %struct.B** %p57, align 4, !dbg !61, !tbaa !57 60*9880d681SAndroid Build Coastguard Worker %p49 = getelementptr inbounds %struct.B, %struct.B* %p, i32 0, i32 1, !dbg !62 61*9880d681SAndroid Build Coastguard Worker %2 = bitcast %struct.B** %p49 to i32*, !dbg !63 62*9880d681SAndroid Build Coastguard Worker store i32 %1, i32* %2, align 4, !dbg !63, !tbaa !53 63*9880d681SAndroid Build Coastguard Worker %p511 = getelementptr inbounds %struct.B, %struct.B* %0, i32 0, i32 2, !dbg !64 64*9880d681SAndroid Build Coastguard Worker store %struct.B* %p, %struct.B** %p511, align 4, !dbg !65, !tbaa !57 65*9880d681SAndroid Build Coastguard Worker store %struct.B* %p, %struct.B** %p2, align 4, !dbg !66, !tbaa !39 66*9880d681SAndroid Build Coastguard Worker br label %return, !dbg !67 67*9880d681SAndroid Build Coastguard Worker 68*9880d681SAndroid Build Coastguard Workerreturn: ; preds = %if.end, %if.then 69*9880d681SAndroid Build Coastguard Worker ret void, !dbg !68 70*9880d681SAndroid Build Coastguard Worker} 71*9880d681SAndroid Build Coastguard Worker 72*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone 73*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind } 76*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind readnone } 77*9880d681SAndroid Build Coastguard Worker 78*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0} 79*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!3, !4} 80*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!5} 81*9880d681SAndroid Build Coastguard Worker 82*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (http://llvm.org/git/clang.git 4b380bc1db8b0c72bdbdaf0e4697b1a84100a369) (http://llvm.org/git/llvm.git 6217a62bc009d55e160dbb694f2e94a22c80809f)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) 83*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "bug.c", directory: "/") 84*9880d681SAndroid Build Coastguard Worker!2 = !{} 85*9880d681SAndroid Build Coastguard Worker!3 = !{i32 2, !"Dwarf Version", i32 4} 86*9880d681SAndroid Build Coastguard Worker!4 = !{i32 2, !"Debug Info Version", i32 3} 87*9880d681SAndroid Build Coastguard Worker!5 = !{!"clang version 3.9.0 (http://llvm.org/git/clang.git 4b380bc1db8b0c72bdbdaf0e4697b1a84100a369) (http://llvm.org/git/llvm.git 6217a62bc009d55e160dbb694f2e94a22c80809f)"} 88*9880d681SAndroid Build Coastguard Worker!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, variables: !25) 89*9880d681SAndroid Build Coastguard Worker!7 = !DISubroutineType(types: !8) 90*9880d681SAndroid Build Coastguard Worker!8 = !{null, !9, !15} 91*9880d681SAndroid Build Coastguard Worker!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 32, align: 32) 92*9880d681SAndroid Build Coastguard Worker!10 = !DIDerivedType(tag: DW_TAG_typedef, name: "A", file: !11, line: 57, baseType: !12) 93*9880d681SAndroid Build Coastguard Worker!11 = !DIFile(filename: "bug.h", directory: "/") 94*9880d681SAndroid Build Coastguard Worker!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !11, line: 54, size: 64, align: 32, elements: !13) 95*9880d681SAndroid Build Coastguard Worker!13 = !{!14, !24} 96*9880d681SAndroid Build Coastguard Worker!14 = !DIDerivedType(tag: DW_TAG_member, name: "p2", scope: !12, file: !11, line: 55, baseType: !15, size: 32, align: 32) 97*9880d681SAndroid Build Coastguard Worker!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 32, align: 32) 98*9880d681SAndroid Build Coastguard Worker!16 = !DIDerivedType(tag: DW_TAG_typedef, name: "B", file: !11, line: 50, baseType: !17) 99*9880d681SAndroid Build Coastguard Worker!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !11, line: 45, size: 96, align: 32, elements: !18) 100*9880d681SAndroid Build Coastguard Worker!18 = !{!19, !21, !23} 101*9880d681SAndroid Build Coastguard Worker!19 = !DIDerivedType(tag: DW_TAG_member, name: "p3", scope: !17, file: !11, line: 47, baseType: !20, size: 32, align: 32) 102*9880d681SAndroid Build Coastguard Worker!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32, align: 32) 103*9880d681SAndroid Build Coastguard Worker!21 = !DIDerivedType(tag: DW_TAG_member, name: "p4", scope: !17, file: !11, line: 48, baseType: !22, size: 32, align: 32, offset: 32) 104*9880d681SAndroid Build Coastguard Worker!22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 32, align: 32) 105*9880d681SAndroid Build Coastguard Worker!23 = !DIDerivedType(tag: DW_TAG_member, name: "p5", scope: !17, file: !11, line: 49, baseType: !22, size: 32, align: 32, offset: 64) 106*9880d681SAndroid Build Coastguard Worker!24 = !DIDerivedType(tag: DW_TAG_member, name: "p1", scope: !12, file: !11, line: 56, baseType: !15, size: 32, align: 32, offset: 32) 107*9880d681SAndroid Build Coastguard Worker!25 = !{!26, !27} 108*9880d681SAndroid Build Coastguard Worker!26 = !DILocalVariable(name: "pA", arg: 1, scope: !6, file: !1, line: 138, type: !9) 109*9880d681SAndroid Build Coastguard Worker!27 = !DILocalVariable(name: "p", arg: 2, scope: !6, file: !1, line: 138, type: !15) 110*9880d681SAndroid Build Coastguard Worker!28 = !DIExpression() 111*9880d681SAndroid Build Coastguard Worker!29 = !DILocation(line: 138, column: 34, scope: !6) 112*9880d681SAndroid Build Coastguard Worker!30 = !DILocation(line: 138, column: 57, scope: !6) 113*9880d681SAndroid Build Coastguard Worker!31 = !DILocation(line: 140, column: 5, scope: !6) 114*9880d681SAndroid Build Coastguard Worker!32 = !DILocation(line: 140, column: 5, scope: !33) 115*9880d681SAndroid Build Coastguard Worker!33 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2) 116*9880d681SAndroid Build Coastguard Worker!34 = !DILocation(line: 141, column: 5, scope: !6) 117*9880d681SAndroid Build Coastguard Worker!35 = !DILocation(line: 141, column: 5, scope: !33) 118*9880d681SAndroid Build Coastguard Worker!36 = !DILocation(line: 143, column: 30, scope: !37) 119*9880d681SAndroid Build Coastguard Worker!37 = distinct !DILexicalBlock(scope: !6, file: !1, line: 143, column: 9) 120*9880d681SAndroid Build Coastguard Worker!38 = !DILocation(line: 155, column: 18, scope: !6) 121*9880d681SAndroid Build Coastguard Worker!39 = !{!40, !41, i64 0} 122*9880d681SAndroid Build Coastguard Worker!40 = !{!"", !41, i64 0, !41, i64 4} 123*9880d681SAndroid Build Coastguard Worker!41 = !{!"any pointer", !42, i64 0} 124*9880d681SAndroid Build Coastguard Worker!42 = !{!"omnipotent char", !43, i64 0} 125*9880d681SAndroid Build Coastguard Worker!43 = !{!"Simple C/C++ TBAA"} 126*9880d681SAndroid Build Coastguard Worker!44 = !DILocation(line: 143, column: 14, scope: !37) 127*9880d681SAndroid Build Coastguard Worker!45 = !DILocation(line: 143, column: 9, scope: !6) 128*9880d681SAndroid Build Coastguard Worker!46 = !DILocation(line: 146, column: 26, scope: !47) 129*9880d681SAndroid Build Coastguard Worker!47 = distinct !DILexicalBlock(scope: !37, file: !1, line: 143, column: 41) 130*9880d681SAndroid Build Coastguard Worker!48 = !DILocation(line: 146, column: 36, scope: !47) 131*9880d681SAndroid Build Coastguard Worker!49 = !{!40, !41, i64 4} 132*9880d681SAndroid Build Coastguard Worker!50 = !DILocation(line: 145, column: 32, scope: !47) 133*9880d681SAndroid Build Coastguard Worker!51 = !DILocation(line: 147, column: 20, scope: !47) 134*9880d681SAndroid Build Coastguard Worker!52 = !DILocation(line: 147, column: 29, scope: !47) 135*9880d681SAndroid Build Coastguard Worker!53 = !{!54, !41, i64 4} 136*9880d681SAndroid Build Coastguard Worker!54 = !{!"B", !41, i64 0, !41, i64 4, !41, i64 8} 137*9880d681SAndroid Build Coastguard Worker!55 = !DILocation(line: 148, column: 20, scope: !47) 138*9880d681SAndroid Build Coastguard Worker!56 = !DILocation(line: 148, column: 29, scope: !47) 139*9880d681SAndroid Build Coastguard Worker!57 = !{!54, !41, i64 8} 140*9880d681SAndroid Build Coastguard Worker!58 = !DILocation(line: 149, column: 9, scope: !47) 141*9880d681SAndroid Build Coastguard Worker!59 = !DILocation(line: 154, column: 41, scope: !6) 142*9880d681SAndroid Build Coastguard Worker!60 = !DILocation(line: 153, column: 16, scope: !6) 143*9880d681SAndroid Build Coastguard Worker!61 = !DILocation(line: 153, column: 25, scope: !6) 144*9880d681SAndroid Build Coastguard Worker!62 = !DILocation(line: 154, column: 16, scope: !6) 145*9880d681SAndroid Build Coastguard Worker!63 = !DILocation(line: 154, column: 26, scope: !6) 146*9880d681SAndroid Build Coastguard Worker!64 = !DILocation(line: 155, column: 29, scope: !6) 147*9880d681SAndroid Build Coastguard Worker!65 = !DILocation(line: 155, column: 39, scope: !6) 148*9880d681SAndroid Build Coastguard Worker!66 = !DILocation(line: 156, column: 28, scope: !6) 149*9880d681SAndroid Build Coastguard Worker!67 = !DILocation(line: 157, column: 1, scope: !6) 150*9880d681SAndroid Build Coastguard Worker!68 = !DILocation(line: 157, column: 1, scope: !69) 151*9880d681SAndroid Build Coastguard Worker!69 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 1) 152