1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -reassociate %s -S -o - | FileCheck %s
4 ; Reassociate pass used to crash on these example
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 fneg (float bitcast (i32 ptrtoint (i32* @g to i32) to float)), float fneg (float bitcast (i32 ptrtoint (i32* @g to i32) to float)))))
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
18 define void @undef2() {
19 ; CHECK-LABEL: @undef2(
20 ; CHECK-NEXT: unreachable
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