load1.ssa 473 B

123456789101112131415161718192021222324252627
  1. # checks that phi arguments are correctly
  2. # handled in alias analysis
  3. export
  4. function w $f(w %cond) {
  5. @start
  6. %x =l alloc4 4
  7. %y =l alloc4 4
  8. storew 0, %x
  9. jnz %cond, @true, @false
  10. @true
  11. jmp @end
  12. @false
  13. jmp @end
  14. @end
  15. %ptr =l phi @true %x, @false %y
  16. storew 1, %ptr
  17. %result =w loadsw %x
  18. ret %result
  19. }
  20. # >>> driver
  21. # extern int f(int);
  22. # int main() {
  23. # return !(f(0) == 0 && f(1) == 1);
  24. # }
  25. # <<<