cf043.ll 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ; RUN: %opt-exe %s -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: entry
  5. ; CHECK: @Loop_Begin
  6. ; CHECK: loop0
  7. ; CHECK: if0
  8. ; CHECK: @If_Begin
  9. ; CHECK: if0.T
  10. ; CHECK: @If_Begin
  11. ; CHECK: dx.LoopExitHelper
  12. ; CHECK: @Loop_Break
  13. ; CHECK: @If_End
  14. ; CHECK: dx.EndIfScope.1
  15. ; CHECK: @If_Else
  16. ; CHECK: if0.F
  17. ; CHECK: @If_End
  18. ; CHECK: dx.EndIfScope
  19. ; CHECK: if0.exit
  20. ; CHECK: dx.LoopContinue
  21. ; CHECK: @Loop_Continue
  22. ; CHECK: loop0.latch
  23. ; CHECK: @Loop_End
  24. ; CHECK: dx.LoopExit
  25. ; CHECK: loop0.exit
  26. ; CHECK: @TopLevel_End
  27. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  28. entry:
  29. %res = alloca i32
  30. store i32 %i1, i32 *%res
  31. br label %loop0
  32. loop0:
  33. %loop0.0 = load i32, i32 *%res
  34. %loop0.1 = icmp eq i32 %loop0.0, 20
  35. br label %if0
  36. if0:
  37. br i1 %c1, label %if0.T, label %if0.F
  38. if0.T:
  39. %if0.T.0 = load i32, i32 *%res
  40. %if0.T.1 = add i32 %if0.T.0, 1
  41. store i32 %if0.T.1, i32 *%res
  42. br i1 %c2, label %loop0.exit, label %if0.exit
  43. if0.F:
  44. store i32 7, i32 *%res
  45. br label %if0.exit
  46. if0.exit:
  47. br label %loop0.latch
  48. loop0.latch:
  49. br label %loop0
  50. loop0.exit:
  51. %ret1 = load i32, i32 *%res
  52. ret i32 %ret1
  53. }