1;; Check that we don't crash. PR37300. 2; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 3; RUN: opt %s -S -simplifycfg | FileCheck %s 4 5define void @patatino() { 6; CHECK-LABEL: @patatino( 7; CHECK-NEXT: bb: 8; CHECK-NEXT: ret void 9; 10bb: 11 %tmp = icmp eq i32 7, 0 12 br label %bb3 13bb3: ; preds = %bb2, %bb 14 br label %bb36 15bb5: ; preds = %bb4 16 %tmp7 = icmp ne i32 7, 0 17 %tmp8 = and i1 true, %tmp7 18 br i1 %tmp8, label %bb16, label %bb14 19bb9: ; preds = %bb33, %bb10 20 br label %bb18 21bb10: ; preds = %bb19, %bb13 22 %tmp11 = add nsw i32 2, 1 23 %tmp12 = icmp eq i32 %tmp11, 0 24 br i1 %tmp12, label %bb17, label %bb9 25bb13: ; preds = %bb18, %bb13 26 br label %bb10 27bb14: ; preds = %bb17, %bb6, %bb5 28 br label %bb35 29bb16: ; preds = %bb6 30 br label %bb31 31bb17: ; preds = %bb32, %bb10 32 br label %bb14 33bb18: ; preds = %bb9 34 br label %bb13 35bb21: ; preds = %bb31, %bb23 36 %tmp22 = phi i32 [ 0, %bb23 ], [ 0, %bb31 ] 37 br label %bb27 38bb23: ; preds = %bb29, %bb28, %bb26 39 %tmp24 = add nsw i32 %tmp22, 1 40 %tmp25 = icmp eq i32 %tmp24, 0 41 br i1 %tmp25, label %bb32, label %bb21 42bb27: ; preds = %bb21 43 br label %bb30 44bb28: ; preds = %bb30 45 br label %bb23 46bb30: ; preds = %bb30, %bb27 47 br label %bb28 48bb31: ; preds = %bb16 49 br label %bb21 50bb32: ; preds = %bb23 51 br label %bb17 52bb35: ; preds = %bb14 53 br label %bb3 54bb36: ; preds = %bb3, %bb3 55 br label %bb37 56bb37: ; preds = %bb36 57 %tmp39 = and i1 %tmp, true 58 br i1 %tmp39, label %bb40, label %bb67 59bb40: ; preds = %bb38 60 br i1 %tmp, label %bb42, label %bb41 61bb41: ; preds = %bb40 62 br label %bb43 63bb42: ; preds = %bb40 64 br label %bb66 65bb43: ; preds = %bb41 66 br label %bb44 67bb44: ; preds = %bb61, %bb43 68 %tmp45 = phi i32 [ 0, %bb61 ], [ 0, %bb43 ] 69 %tmp46 = phi i32 [ %tmp62, %bb61 ], [ 0, %bb43 ] 70 br label %bb51 71bb48: ; preds = %bb47 72 br label %bb49 73bb49: ; preds = %bb48 74 %tmp50 = phi i32 [ 0, %bb48 ] 75 br label %bb61 76bb51: ; preds = %bb44 77 br label %bb52 78bb52: ; preds = %bb55, %bb51 79 %tmp53 = phi i32 [ %tmp46, %bb51 ], [ 0, %bb55 ] 80 br label %bb55 81bb54: ; preds = %bb52 82 br label %bb55 83bb55: ; preds = %bb54, %bb52 84 %tmp56 = phi i32 [ 0, %bb54 ], [ 0, %bb52 ] 85 %tmp57 = shl i32 %tmp56, 16 86 br i1 false, label %bb52, label %bb58 87bb58: ; preds = %bb55 88 %tmp59 = phi i32 [ 0, %bb55 ] 89 %tmp60 = phi i32 [ %tmp53, %bb55 ] 90 br label %bb61 91bb61: ; preds = %bb58, %bb49 92 %tmp62 = phi i32 [ %tmp59, %bb58 ], [ %tmp50, %bb49 ] 93 %tmp63 = add nsw i32 %tmp45, 1 94 %tmp64 = icmp eq i32 %tmp63, 0 95 br i1 %tmp64, label %bb65, label %bb44 96bb65: ; preds = %bb61 97 br label %bb66 98bb66: ; preds = %bb65, %bb42 99 br label %bb67 100bb67: ; preds = %bb66, %bb38 101 ret void 102} 103