Home | History | Annotate | Download | only in LoopUnswitch
      1 ; RUN: opt < %s -S -loop-unswitch -verify-loop-info -verify-dom-info | FileCheck %s
      2 ; PR12343: -loop-unswitch crash on indirect branch
      3 
      4 ; CHECK:       %0 = icmp eq i64 undef, 0
      5 ; CHECK-NEXT:  br i1 %0, label %"5", label %"4"
      6 
      7 ; CHECK:       "5":                                              ; preds = %entry
      8 ; CHECK-NEXT:  br label %"16"
      9 
     10 ; CHECK:       "16":                                             ; preds = %"22", %"5"
     11 ; CHECK-NEXT:  indirectbr i8* undef, [label %"22", label %"33"]
     12 
     13 ; CHECK:       "22":                                             ; preds = %"16"
     14 ; CHECK-NEXT:  br i1 %0, label %"16", label %"26"
     15 
     16 ; CHECK:       "26":                                             ; preds = %"22"
     17 ; CHECK-NEXT:  unreachable
     18 
     19 define void @foo() {
     20 entry:
     21   %0 = icmp eq i64 undef, 0
     22   br i1 %0, label %"5", label %"4"
     23 
     24 "4":                                              ; preds = %entry
     25   unreachable
     26 
     27 "5":                                              ; preds = %entry
     28   br label %"16"
     29 
     30 "16":                                             ; preds = %"22", %"5"
     31   indirectbr i8* undef, [label %"22", label %"33"]
     32 
     33 "22":                                             ; preds = %"16"
     34   br i1 %0, label %"16", label %"26"
     35 
     36 "26":                                             ; preds = %"22"
     37   unreachable
     38 
     39 "33":                                             ; preds = %"16"
     40   unreachable
     41 }
     42