Home | History | Annotate | Download | only in LoopRotate
      1 ; RUN: opt < %s -loop-rotate -S | FileCheck %s
      2 
      3 target triple = "x86_64-pc-windows-msvc"
      4 
      5 declare void @always_throws()
      6 
      7 define i32 @test() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
      8 entry:
      9   invoke void @always_throws()
     10           to label %continue unwind label %catch.dispatch
     11 
     12 continue:
     13   unreachable
     14 
     15 catch.dispatch:
     16   %t0 = catchswitch within none [label %catch] unwind to caller
     17 
     18 catch:
     19   %t1 = catchpad within %t0 [i8* null, i32 64, i8* null]
     20   catchret from %t1 to label %for.cond
     21 
     22 for.cond:
     23   %sum = phi i32 [ %add, %for.body ], [ 0, %catch ]
     24   %i = phi i32 [ %inc, %for.body ], [ 0, %catch ]
     25   %cmp = icmp slt i32 %i, 1
     26   br i1 %cmp, label %for.body, label %return
     27 
     28 for.body:
     29   %add = add nsw i32 1, %sum
     30   %inc = add nsw i32 %i, 1
     31   br label %for.cond
     32 
     33 return:
     34   ret i32 0
     35 }
     36 
     37 ; CHECK: catch:
     38 ; CHECK-NEXT: catchpad
     39 ; CHECK-NEXT: catchret
     40 
     41 declare i32 @__CxxFrameHandler3(...)
     42