Home | History | Annotate | Download | only in StructurizeCFG
      1 ; RUN: opt -S -structurizecfg %s -o - | FileCheck %s
      2 
      3 ; The structurizecfg pass cannot handle switch instructions, so we need to
      4 ; make sure the lower switch pass is always run before structurizecfg.
      5 
      6 ; CHECK-LABEL: @switch
      7 define void @switch(i32 addrspace(1)* %out, i32 %cond) nounwind {
      8 entry:
      9 ; CHECK: icmp
     10   switch i32 %cond, label %done [ i32 0, label %zero]
     11 
     12 ; CHECK: zero:
     13 zero:
     14 ; CHECK: store i32 7, i32 addrspace(1)* %out
     15   store i32 7, i32 addrspace(1)* %out
     16 ; CHECK: br label %done
     17   br label %done
     18 
     19 ; CHECK: done:
     20 done:
     21 ; CHECK: ret void
     22   ret void
     23 }
     24