cf075.ll 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ; RUN: %opt-exe %s -simplifycfg -scopenested -scopenestinfo -analyze -S | %FileCheck %s
  2. ; CHECK: ScopeNestInfo:
  3. ; CHECK: @TopLevel_Begin
  4. ; CHECK: entry
  5. ; CHECK: @If_Begin
  6. ; CHECK: if0
  7. ; CHECK: @If_Begin
  8. ; CHECK: if0.T
  9. ; CHECK: @If_Else
  10. ; CHECK: if0.F
  11. ; CHECK: @If_End
  12. ; CHECK: dx.EndIfScope.1
  13. ; CHECK: @If_Else
  14. ; CHECK: switch0.default
  15. ; CHECK: @If_End
  16. ; CHECK: dx.EndIfScope
  17. ; CHECK: switch0.end
  18. ; CHECK: @TopLevel_End
  19. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  20. entry:
  21. %res = alloca i32
  22. store i32 1, i32 *%res
  23. switch i32 %i1, label %switch0.default [ i32 0, label %if0 ]
  24. if0:
  25. store i32 0, i32 *%res
  26. br i1 %c1, label %if0.T, label %if0.F
  27. if0.T:
  28. store i32 2, i32 *%res
  29. br i1 %c1, label %if1.T, label %if1.F
  30. if1.T:
  31. store i32 11, i32 *%res
  32. br label %if1.end
  33. if1.F:
  34. store i32 12, i32 *%res
  35. br label %switch0.end
  36. if1.end:
  37. br label %if0.end
  38. if0.F:
  39. store i32 3, i32 *%res
  40. br label %if0.end
  41. if0.end:
  42. br label %switch0.end
  43. switch0.default:
  44. store i32 -1, i32 *%res
  45. br label %switch0.end
  46. switch0.end:
  47. %ret.0 = load i32, i32 *%res
  48. ret i32 %ret.0
  49. }