cf150.ll 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ; RUN: %opt-exe %s -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: entry
  5. ; CHECK: @If_Begin
  6. ; CHECK: if0.T
  7. ; CHECK: @Switch_Begin
  8. ; CHECK: @Switch_Case
  9. ; CHECK: switch0.default
  10. ; CHECK: dx.SwitchBreak
  11. ; CHECK: @Switch_Break
  12. ; CHECK: @Switch_Break
  13. ; CHECK: @Switch_Case
  14. ; CHECK: switch0.case0
  15. ; CHECK: @Switch_Break
  16. ; CHECK: @Switch_Case
  17. ; CHECK: switch0.case1
  18. ; CHECK: @If_Begin
  19. ; CHECK: @If_Else
  20. ; CHECK: if1.F
  21. ; CHECK: dx.SwitchBreak.1
  22. ; CHECK: @Switch_Break
  23. ; CHECK: @If_End
  24. ; CHECK: dx.EndIfScope
  25. ; CHECK: if1.T
  26. ; CHECK: @If_Begin
  27. ; CHECK: if2.T
  28. ; CHECK: dx.SwitchBreak.2
  29. ; CHECK: @Switch_Break
  30. ; CHECK: @If_Else
  31. ; CHECK: if2.F
  32. ; CHECK: @If_End
  33. ; CHECK: @Switch_Break
  34. ; CHECK: @Switch_Case
  35. ; CHECK: switch0.case2
  36. ; CHECK: dx.SwitchBreak.3
  37. ; CHECK: @Switch_Break
  38. ; CHECK: @Switch_Break
  39. ; CHECK: @Switch_End
  40. ; CHECK: dx.EndSwitchScope
  41. ; CHECK: switch0.end
  42. ; CHECK: @If_Else
  43. ; CHECK: if2.F.4
  44. ; CHECK: @If_End
  45. ; CHECK: @TopLevel_End
  46. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  47. entry:
  48. %res = alloca i32
  49. store i32 1, i32 *%res
  50. br i1 %c1, label %if0.T, label %if2.F
  51. if0.T:
  52. switch i32 %i1, label %switch0.default [ i32 0, label %switch0.case0
  53. i32 1, label %switch0.case1
  54. i32 11, label %switch0.case1
  55. i32 12, label %switch0.case2
  56. i32 2, label %switch0.case2 ]
  57. switch0.case0:
  58. ret i32 33
  59. switch0.case1:
  60. store i32 1, i32 *%res
  61. br i1 %c1, label %if1.T, label %if1.F
  62. if1.T:
  63. store i32 23, i32 *%res
  64. br i1 %c2, label %if2.T, label %if2.F
  65. if2.T:
  66. store i32 24, i32 *%res
  67. br label %switch0.end
  68. if2.F:
  69. ret i32 888
  70. if1.F:
  71. store i32 21, i32 *%res
  72. br label %switch0.end
  73. switch0.case2:
  74. store i32 2, i32 *%res
  75. br label %switch0.end
  76. switch0.default:
  77. store i32 -1, i32 *%res
  78. br label %switch0.end
  79. switch0.end:
  80. %0 = load i32, i32 *%res
  81. ret i32 %0
  82. }