cf017.ll 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: @If_Begin
  8. ; CHECK: if1.T
  9. ; CHECK: @If_Else
  10. ; CHECK: if.shared
  11. ; CHECK: @If_End
  12. ; CHECK: dx.EndIfScope.1
  13. ; CHECK: @If_Else
  14. ; CHECK: if0.F
  15. ; CHECK: @If_Begin
  16. ; CHECK: if.shared.3
  17. ; CHECK: @If_Else
  18. ; CHECK: if2.F
  19. ; CHECK: @If_End
  20. ; CHECK: dx.EndIfScope.2
  21. ; CHECK: @If_End
  22. ; CHECK: dx.EndIfScope
  23. ; CHECK: if0.end
  24. ; CHECK: @TopLevel_End
  25. define i32 @main(i1 %c1, i1 %c2, i1 %c3, i32 %i1, i32 %i2) {
  26. entry:
  27. %res = alloca i32
  28. store i32 1, i32 *%res
  29. br i1 %c1, label %if0.T, label %if0.F
  30. if0.T:
  31. store i32 2, i32 *%res
  32. br i1 %c2, label %if1.T, label %if.shared
  33. if1.T:
  34. store i32 5, i32 *%res
  35. br label %if0.end
  36. if.shared:
  37. %0 = load i32, i32 *%res
  38. %1 = add i32 %0, 2
  39. store i32 %1, i32 *%res
  40. br label %if0.end
  41. if0.F:
  42. store i32 3, i32 *%res
  43. br i1 %c3, label %if.shared, label %if2.F
  44. if2.F:
  45. store i32 10, i32 *%res
  46. br label %if0.end
  47. if0.end:
  48. %r = load i32, i32 *%res
  49. ret i32 %r
  50. }