Home | History | Annotate | Download | only in Reassociate
      1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
      2 ; RUN: opt -reassociate %s -S -o - | FileCheck %s
      3 
      4 ; Reassociate pass used to crash on these example
      5 
      6 @g = global i32 0
      7 
      8 define float @undef1() {
      9 ; CHECK-LABEL: @undef1(
     10 ; CHECK-NEXT:    ret float fadd (float bitcast (i32 ptrtoint (i32* @g to i32) to float), float fadd (float bitcast (i32 ptrtoint (i32* @g to i32) to float), float fadd (float fsub (float -0.000000e+00, float bitcast (i32 ptrtoint (i32* @g to i32) to float)), float fsub (float -0.000000e+00, float bitcast (i32 ptrtoint (i32* @g to i32) to float)))))
     11 ;
     12   %t0 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), bitcast (i32 ptrtoint (i32* @g to i32) to float)
     13   %t1 = fsub fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), %t0
     14   %t2 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), %t1
     15   ret float %t2
     16 }
     17 
     18 define void @undef2() {
     19 ; CHECK-LABEL: @undef2(
     20 ; CHECK-NEXT:    unreachable
     21 ;
     22   %t0 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), bitcast (i32 ptrtoint (i32* @g to i32) to float)
     23   %t1 = fadd fast float %t0, 1.0
     24   %t2 = fsub fast float %t0, %t1
     25   %t3 = fmul fast float %t2, 2.0
     26   unreachable
     27 }
     28 
     29