cf019.ll 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_Else
  8. ; CHECK: if0.F
  9. ; CHECK: @If_End
  10. ; CHECK: dx.EndIfScope
  11. ; CHECK: if0.end
  12. ; CHECK: if1
  13. ; CHECK: @If_Begin
  14. ; CHECK: if1.T
  15. ; CHECK: @If_End
  16. ; CHECK: dx.EndIfScope.1
  17. ; CHECK: if1.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. br i1 %c1, label %if0.T, label %if0.F
  24. if0.T:
  25. store i32 2, i32 *%res
  26. br label %if0.end
  27. if0.F:
  28. store i32 7, i32 *%res
  29. br label %if0.end
  30. if0.end:
  31. %0 = load i32, i32 *%res
  32. %1 = mul i32 %0, 3
  33. store i32 %1, i32 *%res
  34. br label %if1
  35. if1:
  36. %2 = load i32, i32 *%res
  37. %3 = add i32 %2, 5
  38. store i32 %3, i32 *%res
  39. br i1 %c2, label %if1.T, label %if1.end
  40. if1.T:
  41. store i32 7, i32 *%res
  42. br label %if1.end
  43. if1.end:
  44. %4 = load i32, i32 *%res
  45. ret i32 %4
  46. }