crash2.ll 702 B

12345678910111213141516171819202122232425
  1. ; RUN: opt -reassociate %s -S -o - | FileCheck %s
  2. ; Reassociate pass used to crash on these example
  3. define float @undef1() {
  4. wrapper_entry:
  5. ; CHECK-LABEL: @undef1
  6. ; CHECK: ret float fadd (float undef, float fadd (float undef, float fadd (float fsub (float -0.000000e+00, float undef), float fsub (float -0.000000e+00, float undef))))
  7. %0 = fadd fast float undef, undef
  8. %1 = fsub fast float undef, %0
  9. %2 = fadd fast float undef, %1
  10. ret float %2
  11. }
  12. define void @undef2() {
  13. wrapper_entry:
  14. ; CHECK-LABEL: @undef2
  15. ; CHECK: unreachable
  16. %0 = fadd fast float undef, undef
  17. %1 = fadd fast float %0, 1.000000e+00
  18. %2 = fsub fast float %0, %1
  19. %3 = fmul fast float %2, 2.000000e+00
  20. unreachable
  21. }