Mehdi Amini | 590a270 | 2015-01-16 03:00:58 +0000 | [diff] [blame^] | 1 | ; RUN: opt -reassociate %s -S -o - | FileCheck %s |
| 2 | |
| 3 | ; Reassociate pass used to crash on these example |
| 4 | |
| 5 | |
| 6 | define float @undef1() { |
| 7 | wrapper_entry: |
| 8 | ; CHECK-LABEL: @undef1 |
| 9 | ; 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)))) |
| 10 | %0 = fadd fast float undef, undef |
| 11 | %1 = fsub fast float undef, %0 |
| 12 | %2 = fadd fast float undef, %1 |
| 13 | ret float %2 |
| 14 | } |
| 15 | |
| 16 | define void @undef2() { |
| 17 | wrapper_entry: |
| 18 | ; CHECK-LABEL: @undef2 |
| 19 | ; CHECK: unreachable |
| 20 | %0 = fadd fast float undef, undef |
| 21 | %1 = fadd fast float %0, 1.000000e+00 |
| 22 | %2 = fsub fast float %0, %1 |
| 23 | %3 = fmul fast float %2, 2.000000e+00 |
| 24 | unreachable |
| 25 | } |