switch.ll 564 B

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